forked from prowide/prowide-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
194 lines (168 loc) · 4.62 KB
/
build.gradle
File metadata and controls
194 lines (168 loc) · 4.62 KB
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
185
186
187
188
189
190
191
192
193
194
apply plugin: 'java-library-distribution'
apply plugin: 'maven'
apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'eclipse'
archivesBaseName = 'pw-swift-core'
def SRU = "2020"
version "SRU${SRU}-9.1.2"
group 'com.prowidesoftware'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
tasks.withType(JavaCompile) {
options.fork = true
if (project.hasProperty('JDK8_HOME')) {
options.forkOptions.executable = "$JDK8_HOME/bin/javac"
}
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation 'org.apache.commons:commons-lang3:3.8.1'
implementation 'org.apache.commons:commons-text:1.6'
implementation 'com.google.code.gson:gson:2.8.2'
compileOnly 'javax.persistence:javax.persistence-api:2.2'
compileOnly group: 'javax.validation', name: 'validation-api', version: '1.0.0.GA'
testImplementation('org.junit.jupiter:junit-jupiter:5.7.0')
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.13.2'
testImplementation group: 'org.xmlunit', name: 'xmlunit-core', version: '2.6.3'
testImplementation group: 'org.xmlunit', name: 'xmlunit-matchers', version: '2.6.3'
testImplementation group: 'org.xmlunit', name: 'xmlunit-assertj', version: '2.6.3'
}
sourceSets.main.java.srcDirs = ['src/main/java', 'src/generated/java']
test {
useJUnitPlatform()
}
tasks.withType(Jar) {
manifest.attributes(
'Specification-Title': 'Prowide Core',
'Specification-Version': project.version,
'Specification-Vendor': "SRU${SRU}",
'Implementation-Title': 'Prowide Core',
'Implementation-Version': project.version,
'Implementation-Vendor': 'www.prowidesoftware.com',
'Built-OS': System.getProperty('os.name'),
'Source-Compatibility': project.sourceCompatibility,
'Target-Compatibility': project.targetCompatibility,
'Built-Date': new Date().format("yyyy-MM-dd")
)
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
def formattedDate() {
new Date().format('dd MMM yyyy')
}
javadoc {
failOnError true
options.overview = "overview.html"
options.header = "${version}"
options.windowTitle = "Prowide Core API Reference"
options.footer="SRU${SRU}, generated ${formattedDate()}"
// this will fail when the option is not available (older JDK)
options.addBooleanOption("-allow-script-in-comments", true)
options.bottom = '<script src="//static.getclicky.com/js"></script><script>try{ clicky.init(101039278); }catch(e){}</script>'
exclude "**/internal/**"
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
task writePom {
doLast {
pom {
project {
groupId 'com.prowidesoftware'
artifactId 'pw-swift-core'
version "${version}"
name 'Prowide Core'
description 'Prowide Library for SWIFT messages'
url 'http://www.prowidesoftware.com'
scm {
url 'https://github.com/prowide/prowide-core.git'
connection 'git@github.com:prowide/prowide-core.git'
}
inceptionYear '2006'
licenses {
license {
name 'Apache License Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0'
distribution 'repo'
}
}
developers {
developer {
id 'zubri'
name 'Sebastian Zubrinic'
email 'sebastian@prowidesoftware.com'
}
}
organization {
name 'Prowide'
url 'http://www.prowidesoftware.com'
}
}
}.writeTo("$buildDir/pom.xml")
}
}
distributions {
main {
contents {
from javadocJar
from sourcesJar
into ('lib') {
from (project.configurations.runtime)
}
from files('LICENSE.txt')
from files('CHANGELOG.txt')
from files("$buildDir/pom.xml")
}
}
}
distTar.enabled = false
distZip {
dependsOn writePom
doLast {
if (!project.hasProperty('JDK8_HOME')) {
println "*** WARNING: For releases an explicit JDK8_HOME variable must be set in gradle.properties ***"
}
}
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled false
}
// exclude generated code
afterEvaluate {
getClassDirectories().setFrom(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/SchemeConstants**',
'**/mt0xx/**',
'**/mt1xx/**',
'**/mt2xx/**',
'**/mt3xx/**',
'**/mt4xx/**',
'**/mt5xx/**',
'**/mt6xx/**',
'**/mt7xx/**',
'**/mt8xx/**',
'**/mt9xx/**'
])
})
}
}
test.finalizedBy jacocoTestReport
task bundle(type: Zip, dependsOn: build) {
description 'Creates the bundle.jar for Maven Central distribution'
from jar
from sourcesJar
from javadocJar
from files("$buildDir/pom.xml")
archiveName 'bundle.zip'
}