-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
135 lines (109 loc) · 3.26 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
apply plugin: 'com.moowork.node'
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE")
classpath "com.moowork.gradle:gradle-node-plugin:0.12"
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
configurations {
jaxws
}
dependencies {
// compile 'org.slf4j:slf4j-api:1.7.21'
jaxws 'com.sun.xml.ws:jaxws-tools:2.1.4'
compile("org.springframework.boot:spring-boot-starter-web")
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.springframework.ws:spring-ws-core:2.2.4.RELEASE'
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-all:1.3'
}
sourceSets {
main {
resources {
exclude '**/node_modules/*'
exclude '**/node/*'
exclude '**/typings/*'
}
}
}
task wsimport {
ext.destDir = file("${projectDir}/src/main/generated")
doLast {
ant {
sourceSets.main.output.classesDir.mkdirs()
destDir.mkdirs()
taskdef(name: 'wsimport',
classname: 'com.sun.tools.ws.ant.WsImport',
classpath: configurations.jaxws.asPath
)
wsimport(keep: true,
destdir: sourceSets.main.output.classesDir,
sourcedestdir: destDir,
extension: "true",
verbose: "false",
quiet: "false",
package: "com.gb.calculator.ws",
xnocompile: "true",
wsdl: 'src/main/resources/wsdl/Calculator.wsdl') {
xjcarg(value: "-XautoNameResolution")
}
}
}
}
compileJava {
dependsOn wsimport
source wsimport.destDir
}
import com.moowork.gradle.node.NodeExtension
import com.moowork.gradle.node.variant.VariantBuilder
def staticDir = "src/main/resources/static";
node {
download = true
workDir = file("${project.projectDir}/${staticDir}/node")
nodeModulesDir = file("${project.projectDir}/${staticDir}")
}
String nodeExecutable() {
NodeExtension nodeExt = NodeExtension.get(project)
return new VariantBuilder(nodeExt).build().nodeExec
}
task compileTypeScript(type: NodeTask){
script = file("${staticDir}/node_modules/typescript/lib/tsc.js")
execOverrides {
it.workingDir = file("${project.projectDir}/${staticDir}")
}
}
task npmClean(type: Delete) {
final def webDir = "${rootDir}/src/main/webapp"
delete "${webDir}/node"
delete "${webDir}/node_modules"
delete "${webDir}/typings"
}
task npmTest(type: NpmTask) {
workingDir = file("${project.projectDir}/${staticDir}")
args = ['run', 'test']
}
task buildWebpack(type: NpmTask) {
workingDir = file("${project.projectDir}/${staticDir}")
args = ['run', 'build']
}
compileTypeScript.dependsOn('npmInstall')
buildWebpack.dependsOn('compileTypeScript')
processResources.dependsOn('buildWebpack')
test.dependsOn('npmTest')