mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
[Build] Add buildAndCopyUI Gradle task (#8)
This commit is contained in:
committed by
GitHub
parent
fb03d02456
commit
61ff05c7bb
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user