1+ // file:noinspection GroovyAssignabilityCheck
12import groovy.transform.Memoized
23
34plugins {
@@ -27,16 +28,14 @@ plugins {
2728 id " org.checkerframework" version " 0.6.53"
2829
2930 id(" org.sonarqube" ) version " 6.2.0.5505"
30-
31- id ' org.jreleaser' version ' 1.18.0'
3231}
3332
3433sonar {
35- properties {
36- property " sonar.projectKey" , " KeYProject_key"
37- property " sonar.organization" , " keyproject"
38- property " sonar.host.url" , " https://sonarcloud.io"
39- }
34+ properties {
35+ property " sonar.projectKey" , " KeYProject_key"
36+ property " sonar.organization" , " keyproject"
37+ property " sonar.host.url" , " https://sonarcloud.io"
38+ }
4039}
4140
4241
@@ -106,36 +105,37 @@ subprojects {
106105 testImplementation(" ch.qos.logback:logback-classic:1.5.18" )
107106
108107 testImplementation(platform(" org.junit:junit-bom:5.12.2" ))
109- testImplementation (" org.junit.jupiter:junit-jupiter-api" )
110- testImplementation (" org.junit.jupiter:junit-jupiter-api" )
111- testImplementation (" org.junit.jupiter:junit-jupiter-params" )
112- testRuntimeOnly (" org.junit.jupiter:junit-jupiter-engine" )
113- testRuntimeOnly (" org.junit.platform:junit-platform-launcher" )
108+ testImplementation(" org.junit.jupiter:junit-jupiter-api" )
109+ testImplementation(" org.junit.jupiter:junit-jupiter-api" )
110+ testImplementation(" org.junit.jupiter:junit-jupiter-params" )
111+ testRuntimeOnly(" org.junit.jupiter:junit-jupiter-engine" )
112+ testRuntimeOnly(" org.junit.platform:junit-platform-launcher" )
114113 testImplementation project(' :key.util' )
115114
116115 }
117116
118- tasks. withType(JavaCompile ) {
117+ tasks. withType(JavaCompile ). configureEach {
119118 // Setting UTF-8 as the java source encoding.
120119 options. encoding = " UTF-8"
121120 // Setting the release to Java 21
122121 options. release = 21
123122 }
124123
125- tasks. withType(Javadoc ) {
124+ tasks. withType(Javadoc ). configureEach {
126125 failOnError = false
127126 options. addBooleanOption ' Xdoclint:none' , true
128127 // options.verbose()
129128 options. encoding = ' UTF-8'
130129 options. addBooleanOption(' html5' , true )
131130 }
132131
133- tasks. withType(Test ) {// Configure all tests
132+ tasks. withType(Test ). configureEach {// Configure all tests
134133 systemProperty " test-resources" , " src/test/resources"
135134 systemProperty " testcases" , " src/test/resources/testcase"
136135 systemProperty " TACLET_PROOFS" , " tacletProofs"
137136 systemProperty " EXAMPLES_DIR" , file(" $rootProject /key.ui/examples" )
138- systemProperty " RUNALLPROOFS_DIR" , " $buildDir /report/runallproves"
137+ systemProperty " RUNALLPROOFS_DIR" , layout. buildDirectory. dir(" /report/runallproves" )
138+
139139
140140 systemProperty " key.disregardSettings" , " true"
141141 maxHeapSize = " 4g"
@@ -144,7 +144,7 @@ subprojects {
144144 maxParallelForks = 1 // weigl: test on master
145145 }
146146
147- tasks. withType(Test ) {
147+ tasks. withType(Test ). configureEach {
148148 useJUnitPlatform {
149149 includeEngines ' junit-vintage'
150150 includeEngines ' junit-jupiter'
@@ -172,7 +172,7 @@ subprojects {
172172 }
173173 }
174174
175- task testFast( type : Test ) {
175+ tasks . register( ' testFast ' , Test ) {
176176 group = " verification"
177177 useJUnitPlatform {
178178 excludeTags " slow" , " performance" , " interactive"
@@ -198,14 +198,14 @@ subprojects {
198198 // The following two tasks can be used to execute main methods from the project
199199 // The main class is set via "gradle -DmainClass=... execute --args ..."
200200 // see https://stackoverflow.com/questions/21358466/gradle-to-execute-java-class-without-modifying-build-gradle
201- task execute( type : JavaExec ) {
201+ tasks . register( ' execute ' , JavaExec ) {
202202 description = ' Execute main method from the project. Set main class via "gradle -DmainClass=... execute --args ..."'
203203 group = " application"
204204 mainClass. set(System . getProperty(' mainClass' ))
205205 classpath = sourceSets. main. runtimeClasspath
206206 }
207207
208- task executeInTests( type : JavaExec ) {
208+ tasks . register( ' executeInTests ' , JavaExec ) {
209209 description = ' Execute main method from the project (tests loaded). Set main class via "gradle -DmainClass=... execute --args ..."'
210210 group = " application"
211211 mainClass. set(System . getProperty(' mainClass' ))
@@ -222,7 +222,7 @@ subprojects {
222222 ruleSets = [" category/java/errorprone.xml" , " category/java/bestpractices.xml" ]
223223 }
224224
225- task pmdMainChanged( type : Pmd ) {
225+ tasks . register( ' pmdMainChanged ' , Pmd ) {
226226 // Specify all files that should be checked
227227 def changedFiles = getChangedFiles()
228228 source pmdMain. source. filter { f -> f. getAbsoluteFile(). toString() in changedFiles }
@@ -248,7 +248,7 @@ subprojects {
248248 }
249249
250250
251- task checkstyleMainChanged( type : Checkstyle ) {
251+ tasks . register( ' checkstyleMainChanged ' , Checkstyle ) {
252252 // Specify all files that should be checked
253253 def changedFiles = getChangedFiles()
254254 source checkstyleMain. source. filter { f -> f. getAbsoluteFile(). toString() in changedFiles }
@@ -276,20 +276,20 @@ subprojects {
276276 // html.enabled = true
277277 // }
278278 // }
279- tasks. withType(Pmd ) {
279+ tasks. withType(Pmd ). configureEach {
280280 reports {
281281 xml. getRequired(). set(true )
282282 html. getRequired(). set(true )
283283 }
284284 }
285285
286- task sourcesJar( type : Jar ) {
286+ tasks . register( ' sourcesJar ' , Jar ) {
287287 description = ' Create a jar file with the sources from this project'
288288 from sourceSets. main. allJava
289289 archiveClassifier = ' sources'
290290 }
291291
292- task javadocJar( type : Jar ) {
292+ tasks . register( ' javadocJar ' , Jar ) {
293293 description = ' Create a jar file with the javadocs from this project'
294294 from javadoc
295295 archiveClassifier = ' javadoc'
@@ -382,19 +382,6 @@ subprojects {
382382 }
383383 }
384384
385- // checkerFramework {
386- // checkers = [
387- // "org.checkerframework.checker.nullness.NullnessChecker",
388- // ]
389- // extraJavacArgs = [
390- // "-AonlyDefs=^org\\.key_project\\.util",
391- // "-Xmaxerrs", "10000",
392- // "-Astubs=$projectDir/src/main/checkerframework",
393- // "-Werror",
394- // "-Aversion",
395- // ]
396- // }
397-
398385 afterEvaluate { // required so project.description is non-null as set by sub build.gradle
399386 publishing {
400387 publications {
@@ -451,20 +438,25 @@ subprojects {
451438 */
452439 if (project. version. endsWith(" -SNAPSHOT" )) {
453440 name = " mavenSnapshot"
454- url = " https://s01.oss. sonatype.org/content/repositories/ snapshots/ "
441+ url = " https://central. sonatype.com/repository/maven- snapshots"
455442 credentials(PasswordCredentials ) {
456443 username = project. properties. getOrDefault(" ossrhUsername" , " " )
457444 password = project. properties. getOrDefault(" ossrhPassword" , " " )
458445 }
459446 } else {
460447 name = " mavenStaging"
461- url = " https://s01.oss .sonatype.org /service/local/staging/deploy/maven2/"
448+ url = " https://ossrh-staging-api.central .sonatype.com /service/local/staging/deploy/maven2/"
462449 credentials(PasswordCredentials ) {
463450 username = project. properties. getOrDefault(" ossrhUsername" , " " )
464451 password = project. properties. getOrDefault(" ossrhPassword" , " " )
465452 }
466453 }
467454 }
455+
456+ maven {
457+ name = " localRepo"
458+ url = " $rootDir /localRepo" // Replace with your desired folder
459+ }
468460 }
469461 }
470462
@@ -475,22 +467,22 @@ subprojects {
475467 }
476468}
477469
478- task start {
470+ tasks . register( ' start' ) {
479471 description = " Use :key.ui:run instead"
480472 doFirst {
481473 println " Use :key.ui:run instead"
482474 }
483475}
484476
485477// Generation of a JavaDoc across sub projects.
486- task alldoc ( type : Javadoc ) {
478+ tasks . register( ' alldoc ' , Javadoc ){
487479 group = " documentation"
488480 description = " Generate a JavaDoc across sub projects"
489481 def projects = subprojects
490482 // key.ui javadoc is broken
491483 source projects. collect { it. sourceSets. main. allJava }
492484 classpath = files(projects. collect { it. sourceSets. main. compileClasspath })
493- destinationDir = file(" ${ buildDir } / docs/javadoc" )
485+ destinationDir = layout . buildDirectory . file(" docs/javadoc" ) . get( )
494486
495487 if (JavaVersion . current(). isJava9Compatible()) {
496488 // notworking on jenkins
@@ -514,66 +506,8 @@ task alldoc(type: Javadoc) {
514506 }
515507}
516508
517-
518- jreleaser {
519- project {
520- authors = [' KeY Developers' ]
521- license = ' GPL-v2.0'
522- links {
523- homepage = " https://www.key-project.org/"
524- // issueTracker = 'https://github.com/keyproject/key/issues'
525- // scm = 'https://github.com/keyproject/key.git'
526- }
527- inceptionYear = ' 2025'
528- }
529-
530- release {
531- github {
532- repoOwner = ' keyproject'
533- overwrite = true
534- }
535- }
536- distributions {
537- app {
538- artifact {
539- path = ' build/distributions/{{distributionName}}-{{projectVersion}}.zip'
540- }
541- }
542- }
543-
544- signing {
545- active = ' ALWAYS'
546- armored = true
547- }
548- deploy {
549- maven {
550- mavenCentral {
551- ' release-deploy' {
552- active = ' RELEASE'
553- url = ' https://central.sonatype.com/api/v1/publisher'
554- // releaseRepository = false
555- stagingRepository(' target/staging-deploy' )
556- }
557- }
558- nexus2 {
559- ' snapshot-deploy' {
560- active = ' SNAPSHOT'
561- snapshotUrl = ' https://central.sonatype.com/repository/maven-snapshots'
562- applyMavenCentralRules = true
563- snapshotSupported = true
564- closeRepository = true
565- releaseRepository = true
566- stagingRepository(' target/staging-deploy' )
567- }
568- }
569- }
570- }
571- }
572-
573-
574-
575509// Creates a jar file with the javadoc over all sub projects.
576- task alldocJar ( type : Zip ) {
510+ tasks . register( ' alldocJar ' , Zip ){
577511 dependsOn alldoc
578512 description = ' Create a jar file with the javadoc over all sub projects'
579513 from alldoc
0 commit comments