-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathbuild.gradle
More file actions
156 lines (132 loc) · 4.28 KB
/
Copy pathbuild.gradle
File metadata and controls
156 lines (132 loc) · 4.28 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
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.SonatypeHost
plugins {
id 'java-library'
id 'checkstyle'
id 'jacoco'
id "com.github.spotbugs" version '6.5.6'
id 'com.adarshr.test-logger' version '4.0.0'
id "com.github.ben-manes.versions" version '0.54.0'
id "org.sonarqube" version '7.3.1.8318'
id 'com.vanniktech.maven.publish' version '0.31.0'
}
group = 'com.imsweb'
version = '1.16'
description = 'Java client library for parsing x12 files'
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << "-Werror" << "-Xlint:-options"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
dependencies {
api 'com.thoughtworks.xstream:xstream:1.4.21'
testImplementation platform('org.junit:junit-bom:5.12.2')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2'
testImplementation 'commons-io:commons-io:2.22.0'
testImplementation 'org.jsoup:jsoup:1.20.1'
testImplementation 'com.jayway.jsonpath:json-path:2.9.0'
}
jar {
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': archiveVersion,
'Implementation-Vendor': group,
'Created-By': System.properties['java.vm.version'] + ' (' + System.properties['java.vm.vendor'] + ')',
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Automatic-Module-Name': 'com.imsweb.x12'
)
}
}
test {
useJUnitPlatform()
}
checkstyle {
toolVersion '8.29'
configFile = file('config/checkstyle/checkstyle.xml')
}
spotbugs {
excludeFilter = file('config/spotbugs/spotbugs-exclude.xml')
}
jacocoTestReport {
reports {
xml.required = true
}
}
test.finalizedBy jacocoTestReport
sonar {
properties {
property "sonar.projectKey", "imsweb_x12-parser"
property "sonar.organization", "imsweb"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.gradle.skipCompile", "true"
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { qualifier -> version.toUpperCase().contains(qualifier) }
def regex = /^[0-9,.v-]+$/
return !stableKeyword && !(version ==~ regex)
}
dependencyUpdates {
// ignore alpha, beta, etc. versions
rejectVersionIf { selection ->
isNonStable(selection.candidate.version)
}
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
options.addStringOption('Xdoclint:none', '-quiet')
}
}
mavenPublishing {
configure(new JavaLibrary(new JavadocJar.Javadoc(), true))
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
signAllPublications()
pom {
name = 'X12 Parser'
description = 'A Java library for parsing X12 files, including ANSI 837'
url = 'https://github.com/imsweb/x12-parser'
inceptionYear = '2015'
licenses {
license {
name = 'A modified BSD License (BSD)'
url = 'https://github.com/imsweb/x12-parser/blob/master/LICENSE'
distribution = 'repo'
}
}
developers {
developer {
id = 'AngelaszekD'
name = 'David Angelaszek'
email = 'AngelaszekD@imsweb.com'
}
developer {
id = 'ctmay4'
name = 'Chuck May'
email = 'mayc@imsweb.com'
}
}
scm {
url = 'https://github.com/imsweb/x12-parser'
connection = 'scm:https://github.com/imsweb/x12-parser.git'
developerConnection = 'scm:git@github.com:imsweb/x12-parser.git'
}
}
}
wrapper {
gradleVersion = '9.5.1'
distributionType = Wrapper.DistributionType.ALL
}