11/*
22 * This file defines the steps to build Synthea using Gradle. Full documentation of the syntax
3- * can be found at https://docs.gradle.org/6.5 /userguide/java_plugin.html
3+ * can be found at https://docs.gradle.org/8.14 /userguide/java_plugin.html
44 */
55
66buildscript {
77 repositories {
8+ mavenCentral()
9+ }
10+ dependencies {
11+ classpath ' com.gradleup.shadow:shadow-gradle-plugin:8.3.9'
12+ }
13+ }
14+
15+ buildscript {
16+ repositories {
17+ mavenCentral()
818 maven {
9- url " https://plugins.gradle .org/m2/ "
19+ url = " https://oss.sonatype .org/content/repositories/snapshots "
1020 }
1121 }
1222 dependencies {
13- classpath " gradle.plugin.com.github.johnrengelman:shadow:7.1.2"
23+ // commons-io used in getting the version id below
24+ classpath group : ' commons-io' , name : ' commons-io' , version : ' 2.5'
25+ // note that commons-io is already a dependency
26+ // of commons-csv in the primary dependencies above
1427 }
1528}
16- apply plugin : " com.github.johnrengelman.shadow"
17-
18- // Apply the java plugin to add support for Java
19- apply plugin : ' java'
2029
21- sourceCompatibility = ' 11'
30+ plugins {
31+ id ' java'
32+ id ' com.gradleup.shadow' version ' 8.3.9'
33+ id ' application'
34+ id ' eclipse'
35+ id ' checkstyle'
36+ id ' jacoco'
37+ id ' maven-publish'
38+ id ' signing'
39+ }
2240
23- apply plugin : ' application'
24- apply plugin : ' eclipse'
25- apply plugin : ' checkstyle'
26- apply plugin : ' jacoco'
27- apply plugin : ' maven-publish'
28- apply plugin : ' signing'
41+ java {
42+ sourceCompatibility = ' 11'
43+ }
2944
3045// In this section you declare where to find the dependencies of your project
3146repositories {
3247 mavenCentral()
3348 maven {
34- url " https://oss.sonatype.org/content/repositories/snapshots"
49+ url = " https://oss.sonatype.org/content/repositories/snapshots"
3550 }
3651}
3752
@@ -41,12 +56,12 @@ repositories {
4156// }
4257
4358checkstyle {
44- toolVersion ' 8.4'
59+ toolVersion = ' 8.4'
4560 // showViolations = true
4661}
4762
4863jacoco {
49- toolVersion ' 0.8.7'
64+ toolVersion = ' 0.8.7'
5065}
5166
5267dependencies {
@@ -155,21 +170,6 @@ test {
155170 }
156171}
157172
158- buildscript {
159- repositories {
160- mavenCentral()
161- maven {
162- url " https://oss.sonatype.org/content/repositories/snapshots"
163- }
164- }
165- dependencies {
166- // commons-io used in getting the version id below
167- classpath group : ' commons-io' , name : ' commons-io' , version : ' 2.5'
168- // note that commons-io is already a dependency
169- // of commons-csv in the primary dependencies above
170- }
171- }
172-
173173jacocoTestReport {
174174 reports {
175175 xml. required = true
@@ -180,8 +180,8 @@ jacocoTestReport {
180180check. dependsOn jacocoTestReport
181181
182182task graphviz (type : JavaExec ) {
183- group ' Application'
184- description ' Generate rule visualization'
183+ group = ' Application'
184+ description = ' Generate rule visualization'
185185 classpath sourceSets. main. runtimeClasspath
186186 mainClass = " Graphviz"
187187}
@@ -200,15 +200,15 @@ tasks.javadoc {
200200}
201201
202202task rifMinimize (type : JavaExec ) {
203- group ' Application'
204- description ' Filter exported RIF files to produce minimal set that covers all claim types'
203+ group = ' Application'
204+ description = ' Filter exported RIF files to produce minimal set that covers all claim types'
205205 classpath sourceSets. main. runtimeClasspath
206206 mainClass = " org.mitre.synthea.export.rif.tools.BB2RIFMinimizer"
207207}
208208
209209task rif2CCW (type : JavaExec ) {
210- group ' Application'
211- description ' Convert exported RIF files from BB2 format to CCW format'
210+ group = ' Application'
211+ description = ' Convert exported RIF files from BB2 format to CCW format'
212212 classpath sourceSets. main. runtimeClasspath
213213 mainClass = " org.mitre.synthea.export.rif.tools.BB2RIF2CCW"
214214}
@@ -219,15 +219,15 @@ if (project.hasProperty("args")) {
219219 ext. cmdLineArgs = " "
220220}
221221task rifBeneSplit (type : JavaExec ) {
222- group ' Application'
223- description ' Split original 3 RIF file bene export into one file per year'
222+ group = ' Application'
223+ description = ' Split original 3 RIF file bene export into one file per year'
224224 classpath sourceSets. main. runtimeClasspath
225225 mainClass = " org.mitre.synthea.export.rif.tools.BB2RIFBeneSplitter"
226226 args cmdLineArgs. split()
227227}
228228
229229shadowJar {
230- zip64 true
230+ zip64 = true
231231 def versionFile = new File (" $projectDir /src/main/resources/version.txt" )
232232 def versionText = " N/A"
233233 if (versionFile. exists()) {
@@ -252,8 +252,8 @@ task uberJar() {
252252}
253253
254254task flexporter (type : JavaExec ) {
255- group ' Application'
256- description ' Apply transformations to FHIR'
255+ group = ' Application'
256+ description = ' Apply transformations to FHIR'
257257 classpath sourceSets. main. runtimeClasspath
258258 mainClass = " RunFlexporter"
259259 // args are called "arams" because they are called with -P,
@@ -265,31 +265,31 @@ task flexporter(type: JavaExec) {
265265}
266266
267267task concepts (type : JavaExec ) {
268- group ' Application'
269- description ' Create a list of simulated concepts'
268+ group = ' Application'
269+ description = ' Create a list of simulated concepts'
270270 classpath sourceSets. main. runtimeClasspath
271271 mainClass = " org.mitre.synthea.helpers.Concepts"
272272 args ' false'
273273}
274274
275275task conceptswithoutcosts (type : JavaExec ) {
276- group ' Application'
277- description ' Create a list of simulated concepts without costs'
276+ group = ' Application'
277+ description = ' Create a list of simulated concepts without costs'
278278 classpath sourceSets. main. runtimeClasspath
279279 mainClass = " org.mitre.synthea.helpers.Concepts"
280280 args ' true'
281281}
282282
283283task attributes (type : JavaExec ) {
284- group ' Application'
285- description ' Create a list of patient attributes'
284+ group = ' Application'
285+ description = ' Create a list of patient attributes'
286286 classpath sourceSets. main. runtimeClasspath
287287 mainClass = " org.mitre.synthea.helpers.Attributes"
288288}
289289
290290task overrides (type : JavaExec ) {
291- group ' Application'
292- description ' Create a list of modules parameters in module override format'
291+ group = ' Application'
292+ description = ' Create a list of modules parameters in module override format'
293293 classpath sourceSets. main. runtimeClasspath
294294 mainClass = " org.mitre.synthea.helpers.ModuleOverrides"
295295 doFirst {
@@ -304,15 +304,15 @@ task overrides(type: JavaExec) {
304304}
305305
306306task physiology (type : JavaExec ) {
307- group ' Application'
308- description ' Test a physiology simulation'
307+ group = ' Application'
308+ description = ' Test a physiology simulation'
309309 classpath sourceSets. main. runtimeClasspath
310310 mainClass = " org.mitre.synthea.engine.PhysiologySimulator"
311311}
312312
313313task versionTxt () {
314- group ' Build'
315- description ' Generates a version file.'
314+ group = ' Build'
315+ description = ' Generates a version file.'
316316 doLast {
317317 try {
318318 // the ruby version uses `git rev-parse HEAD` which just produces the long commit hash.
@@ -344,7 +344,9 @@ task cleanOutput {
344344}
345345
346346// Define the main class for the application
347- mainClassName = ' App'
347+ application {
348+ mainClass = ' App'
349+ }
348350
349351run {
350352 // args are called "arams" because they are called with -P,
@@ -381,8 +383,8 @@ def mavenVersion = '3.3.1-SNAPSHOT'
381383publishing {
382384 publications {
383385 synthea(MavenPublication ) {
384- groupId mavenGroup
385- version mavenVersion
386+ groupId = mavenGroup
387+ version = mavenVersion
386388 from components. java
387389
388390 artifact(sourceJar) {
@@ -421,18 +423,18 @@ publishing {
421423 maven {
422424 def snapshotUrl = ' https://oss.sonatype.org/content/repositories/snapshots'
423425 def releaseUrl = ' https://oss.sonatype.org/service/local/staging/deploy/maven2/'
424- url mavenVersion. endsWith(' SNAPSHOT' ) ? snapshotUrl : releaseUrl
426+ url = mavenVersion. endsWith(' SNAPSHOT' ) ? snapshotUrl : releaseUrl
425427 credentials {
426428 def user = project. hasProperty(' ossToken' ) ? ossToken : ' '
427429 def pw = project. hasProperty(' ossTokenPassword' ) ? ossTokenPassword : ' '
428- username user
429- password pw
430+ username = user
431+ password = pw
430432 }
431433 }
432434 }
433435}
434436
435437signing {
436- required { project. hasProperty(' signing.keyId' ) }
438+ required = { project. hasProperty(' signing.keyId' ) }
437439 sign publishing. publications. synthea
438440}
0 commit comments