mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
18.07.2021 422b80e3a4a56a98ccb322ba210b36f9e823c255
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
description = 'borgbutler-webapp'
 
task npmBuild(type: Exec) {
    workingDir '.'
    executable 'sh'
    commandLine 'npm', 'run', 'build'
}
 
task packageWebApp(type: Zip) {
    outputs.upToDateWhen { false } // It's never up-to-date (otherwise borgbutler-webapp.jar is missed).
    dependsOn npmBuild
    archiveBaseName.set('borgbutler-webapp')
    archiveExtension.set('jar')
    destinationDirectory.set(file("${projectDir}"))
    from('build') {
        // optional path under which output will be visible in Java classpath, e.g. static resources path
        into 'webapp'
    }
    doLast {
        //println "**** projectDir=${projectDir}, buildDir=${buildDir}"
        mkdir "${buildDir}/libs"
        def jarFile = archiveFileName.get()
        ant.move file: "${projectDir}/${jarFile}",
                toDir: "${buildDir}/libs"
        println("*** packageWebApp finished.")
    }
}