Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
154 lines (130 loc) · 4.95 KB
/
Copy pathbuild.gradle
File metadata and controls
154 lines (130 loc) · 4.95 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
import com.vanniktech.maven.publish.*
plugins {
id 'java-library'
id 'jacoco'
id 'com.vanniktech.maven.publish' version '0.37.0' // publish to Maven Central
id 'com.github.ben-manes.versions' version '0.64.0' // check for out-of-date dependencies (run 'dependencyUpdates' manually)
id 'com.github.spotbugs' version '6.5.12' // spotbugs code analysis
id 'org.sonarqube' version '7.5.0.8588' // sonarQube analysis
}
group = 'com.imsweb'
version = file('VERSION').text.trim()
description = 'This framework allows edits to be defined in Groovy and to be executed on various data types.'
println "Starting build using JDK ${Runtime.version().feature()}"
repositories {
mavenCentral()
}
dependencies {
api 'com.imsweb:staging-client-java:11.11.1'
api 'org.apache.groovy:groovy:5.0.5'
api 'com.thoughtworks.xstream:xstream:1.4.21'
implementation 'commons-codec:commons-codec:1.22.1'
implementation 'org.apache.commons:commons-lang3:3.21.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'commons-io:commons-io:2.22.0'
testImplementation 'com.imsweb:layout:7.1'
testImplementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.26.1'
testImplementation('com.imsweb:validation-edits-seer:026-09') { exclude module: 'validation' }
testImplementation('com.imsweb:validation-edits-naaccr-translated:024-03') { exclude module: 'validation' }
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
}
tasks.withType(Javadoc).configureEach {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
options.addBooleanOption('html5', true)
}
jar {
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': version,
'Implementation-Vendor': 'Information Management Services Inc.',
'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.validation'
)
}
}
// jacoco plugin settings
jacocoTestReport {
reports {
xml.required = true
}
}
test.finalizedBy jacocoTestReport
// spotbugs plugin settings
spotbugs {
ignoreFailures = false
excludeFilter.set(file('config/spotbugs/spotbugs-exclude.xml'))
}
sonarqube {
properties {
property "sonar.projectKey", "imsweb_validation"
property "sonar.organization", "imsweb"
property "sonar.host.url", "https://sonarcloud.io"
property 'sonar.exclusions', '**/lab/*'
property 'sonar.coverage.exclusions', '**/lab/*'
}
}
// use this task to generate the regex parser
tasks.register('generateJavaContextParser', JavaExec) {
group = 'context'
classpath = files('config/jflex-1.4.2/lib/JFlex.jar')
args = ['--nobak', '-d', 'src/main/java/com/imsweb/validation/internal/context/', 'config/java-context.flex']
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
// https://github.com/ben-manes/gradle-versions-plugin
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
// needed to deploy to Maven Central Portal
mavenPublishing {
configure(new JavaLibrary(new JavadocJar.Javadoc(), new SourcesJar.Sources()))
publishToMavenCentral(true)
signAllPublications()
pom {
name = 'Validation Framework'
description = 'This framework allows edits to be defined in Groovy and to be executed on various data types.'
url = 'https://github.com/imsweb/validation'
inceptionYear = '2015'
licenses {
license {
name = 'A modified BSD License (BSD)'
url = 'https://github.com/imsweb/validation/blob/master/LICENSE'
distribution = 'repo'
}
}
developers {
developer {
id = 'depryf'
name = 'Fabian Depry'
email = 'depryf@imsweb.com'
}
}
scm {
url = 'https://github.com/imsweb/validation'
connection = 'scm:https://github.com/imsweb/validation.git'
developerConnection = 'scm:git@github.com:imsweb/validation.git'
}
}
}
// Gradle wrapper, this allows to build the project without having to install Gradle!
wrapper {
gradleVersion = '9.8.0'
distributionType = Wrapper.DistributionType.ALL
}