-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
89 lines (71 loc) · 2.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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.10.RELEASE")
}
}
apply plugin: 'java-library'
apply plugin: "org.springframework.boot"
repositories {
jcenter()
}
ext {
schemaSources = file("$project.projectDir/src/main/resources/schema")
generatedBeansSources = file("$buildDir/generated-beans")
compiledBeans = file("$buildDir/classes")
}
dependencies {
compile files(file("${project.name}.jar"))
compile "org.apache.camel:camel-spring-boot-starter:$camelVersion"
compile "org.apache.camel:camel-cxf:$camelVersion"
compile "org.apache.camel:camel-jaxb:$camelVersion"
compile "org.apache.cxf:cxf-codegen-plugin:$cxfVersion"
compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion"
compile "org.springframework.boot:spring-boot-actuator:$springBootVersion"
compile "org.springframework.boot:spring-boot-devtools:$springBootVersion"
testImplementation "junit:junit:$junitVersion"
testImplementation "org.apache.camel:camel-test:$camelVersion"
testImplementation "org.apache.camel:camel-test-spring:$camelVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
}
bootRun {
//jvmArgs = ["-Dx=y"]
}
task generateWsdlJavaClasses(type: Jar) {
dependsOn processResources
// Always run this task
outputs.upToDateWhen { false }
archiveName = "${project.name}.jar"
destinationDir = project.projectDir
manifest {
attributes = ["Implementation-Version": 1.0]
}
from(schemaSources) {
into "schema"
}
from compiledBeans
doFirst {
delete generatedBeansSources
delete compiledBeans
wsdlToJavaJaxb("logfiles.wsdl")
}
}
ExecResult wsdlToJavaJaxb(String wsdlFile, String namespace = null) {
javaexec {
classpath = configurations.compile
main = "org.apache.cxf.tools.wsdlto.WSDLToJava"
defaultCharacterEncoding = "utf-8"
args "-db", "jaxb"
args "-impl"
args "-compile"
args "-classdir", compiledBeans
if (namespace) {
args "-p", namespace
}
args "-d", generatedBeansSources
args file("$schemaSources/$wsdlFile")
println("$schemaSources/$wsdlFile")
}
}