-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
57 lines (49 loc) · 1.21 KB
/
build.gradle
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
plugins {
id "com.moowork.node" version "1.3.1"
id 'com.github.ben-manes.versions' version '0.27.0'
}
apply plugin:'java'
apply plugin: 'maven'
node {
version = '10.15.3'
npmVersion = '6.4.1'
download = true
distBaseUrl = "https://direct.nodejs.org/dist"
workDir = file("${project.projectDir}/node")
nodeModulesDir = file("${project.projectDir}/")
}
task npmClean(type: Delete) {
final def webDir = "${rootDir}/frontend"
delete "${webDir}/node"
delete "${webDir}/node_modules"
delete "${webDir}/dist"
delete "${webDir}/coverage"
}
// clean task for npm
clean.dependsOn(npmClean)
// build task for npm
processResources.dependsOn(npm_install)
processResources.dependsOn(npm_run_build)
jar {
archiveBaseName.set('alfio-public-frontend')
version = "${project.version}"
into("META-INF/resources/webjars/${archiveBaseName.get()}/${project.version}") {
from 'dist'
}
}
// run all task
task runAll {}
runAll.dependsOn(npm_run_start)
install {
repositories.mavenInstaller {
pom.project {
licenses {
license {
name 'GNU General Public License, Version 3'
url 'https://www.gnu.org/licenses/gpl-3.0.en.html'
distribution 'repo'
}
}
}
}
}