[Build] Add buildAndCopyUI Gradle task (#8)

This commit is contained in:
Prateek Machiraju
2020-06-28 17:57:23 -04:00
committed by GitHub
parent fb03d02456
commit 61ff05c7bb

View File

@@ -90,6 +90,27 @@ task testHeadless(type: Test) {
useJUnitPlatform()
}
task runNpmOnClient(type: Exec) {
workingDir "${projectDir}/../photon-client"
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'cmd', '/c', 'npm run build'
} else {
commandLine 'npm run build'
}
}
task copyClientUIToResources(type: Copy) {
from "${projectDir}/../photon-client/dist/"
into "${projectDir}/src/main/resources/web/"
}
task buildAndCopyUI {}
buildAndCopyUI.dependsOn copyClientUIToResources
copyClientUIToResources.dependsOn runNpmOnClient
copyClientUIToResources.shouldRunAfter runNpmOnClient
spotless {
java {
googleJavaFormat()