-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
184 lines (161 loc) · 5.24 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
buildscript {
dependencies {
classpath 'de.gematik:gematik-parent-plugin:1.3.2'
//Todo activate after documentation-plugin is updated
// classpath 'de.gematik:documentation-plugin:1.1.2'
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
maven { url "https://plugins.gradle.org/m2/" }
}
}
apply plugin: 'de.gematik.parent'
apply plugin: 'de.gematik.publish'
//apply plugin: 'de.gematik.asciidoctor'
apply plugin: 'distribution'
group = 'de.gematik.ti.epa'
description = 'Verzeichnisdienst Client'
sourceSets {
main.java.srcDirs = ['src/main/java', 'build/generated-sources/jaxb']
test.java.srcDirs = ['src/test/java']
}
javadoc {
failOnError = false
options.noTimestamp = true
}
configurations {
jaxb
}
dependencies {
implementation 'io.swagger:swagger-annotations:1.6.6'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'io.gsonfire:gson-fire:1.8.5'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2'
implementation 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.common:1.0.2'
implementation 'org.apache.logging.log4j:log4j-core:2.17.2'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2'
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'com.sun.xml.bind:jaxb-impl:2.3.1'
implementation 'com.sun.xml.bind:jaxb-core:2.3.0.1'
implementation 'commons-io:commons-io:2.5'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
jaxb 'com.sun.xml.bind:jaxb-xjc:2.3.1'
jaxb 'org.glassfish.jaxb:jaxb-runtime:2.3.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:4.5.1'
}
jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest.attributes 'Main-Class': 'de.gematik.ti.epa.vzd.gem.Main'
manifest.attributes 'version': new File('./version.txt').withReader { reader -> reader.readLine() }
baseName project.name
from configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
task jaxb {
description 'Converts xsds to classes'
doLast {
def jaxbTargetDir = file("build/generated-sources/jaxb/")
jaxbTargetDir.mkdirs()
ant.taskdef(
name: 'xjc',
classname: 'com.sun.tools.xjc.XJCTask',
classpath: configurations.jaxb.asPath
)
ant.jaxbTargetDir = jaxbTargetDir
ant.xjc(
destdir: '${jaxbTargetDir}',
package: 'generated',
schema: 'src/main/resources/jaxb/commands.xsd',
binding: 'src/main/resources/jaxb/binding.xml',
extension: 'true')
}
}
compileJava.dependsOn jaxb
task sourceJar(type: Jar) {
classifier "sources"
from "${project.buildDir}/../src/main/java/"
include "**/*.java"
from "."
include "version.txt"
}
task testSourceJar(type: Jar) {
classifier "test-sources"
from "${project.buildDir}/../src/test/java/"
include "**/*.java"
}
task adocJar(type: Jar) {
classifier "adoc"
from "${project.buildDir}/../doc"
into "${project.name}"
exclude "**/generated/**/*.*"
}
task javadocJar(type: Jar) {
classifier "javadoc"
from "${project.buildDir}/docs/javadoc"
into "${project.name}"
}
artifacts {
archives sourceJar
archives testSourceJar
archives adocJar
archives javadocJar
}
gematikPublish {
name = project.name
description = "VZD-Client to add, remove and change data"
gitHubProjectName = "app-VZD-Client"
}
distributions {
main {
contents {
into(project.name) {
from jar
rename '(.*)-.*.jar', project.name + '.jar'
}
into('') {
from '.'
include 'vorlage_commands_data.xml'
include 'doc/**'
from 'bspData/'
include 'startVzdClient.bat'
include 'startVzdC_Log.bat'
include 'Beispiel_Config_Datei.txt'
include 'Beispiel_Credential_Datei.txt'
include 'Beispiel_Command_Datei.xml'
from 'src/main/resources/xsd/'
include 'commands.xsd'
}
}
}
}
tasks.named("build") { finalizedBy("copyZipToLibFolder") }
tasks.register("copyZipToLibFolder",Copy) {
from layout.buildDirectory.file("distributions/VZD-Client-1.6.4-SNAPSHOT.zip")
into layout.buildDirectory.dir("libs")
}
test {
include '**/UnitTestsuite.class'
include '**/IntegrationTestsuite.class'
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
reports {
xml.enabled true
xml.destination file("${buildDir}/jacoco/dependency-check-report.xml")
csv.enabled false
}
}