Skip to content

Commit 44313ee

Browse files
authored
Add tasks in center gradle for building front end web (#206)
* Add tasks in center gradle for building front end web * Update build.gradle
1 parent 002da44 commit 44313ee

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

center/build.gradle

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ version = hydraLabVersion
88
sourceCompatibility = 11
99
targetCompatibility = 11
1010

11+
repositories {
12+
mavenCentral()
13+
}
14+
1115
bootJar {
1216
// Specify the out jar file name so that the dockerfile could copy it
1317
// without concerning the name change caused by version change.
@@ -60,6 +64,18 @@ dependencies {
6064
annotationProcessor 'org.projectlombok:lombok:1.18.20'
6165
}
6266

63-
repositories {
64-
mavenCentral()
65-
}
67+
import org.apache.tools.ant.taskdefs.condition.Os
68+
String npmCommand = 'npm'
69+
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
70+
npmCommand = 'npm.cmd'
71+
}
72+
String reactDir = "${projectDir.parentFile.absolutePath}${File.separator}react"
73+
task installWebFront(type: Exec, group: 'build') {
74+
workingDir reactDir
75+
commandLine npmCommand, 'ci'
76+
}
77+
78+
task buildWebFront(type: Exec, group: 'build', dependsOn: installWebFront) {
79+
workingDir reactDir
80+
commandLine npmCommand, 'run', 'pub'
81+
}

0 commit comments

Comments
 (0)