1+ import com.github.spotbugs.snom.Effort
2+
3+
14buildscript {
25 repositories {
36 mavenCentral()
47 mavenLocal()
58 maven {
6- url " https://plugins.gradle.org/m2/"
9+ url = " http://localhost:8081/artifactory/libs-release-local"
10+ allowInsecureProtocol = true
11+ credentials {
12+ username = " ${ artifactory_user} "
13+ password = " ${ artifactory_password} "
14+ }
715 }
816 }
17+
918 dependencies {
1019 // Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
11- classpath(group : ' org.jfrog.buildinfo' , name : ' build-info-extractor-gradle' , version : ' 4.+ ' )
20+ classpath(" org.jfrog.buildinfo: build-info-extractor-gradle:6.+ " )
1221 }
1322}
1423
1524plugins {
16- id " com.github.spotbugs" version " 5.0.12 "
25+ id " com.github.spotbugs" version " 6.2.5 "
1726 id ' java'
1827 id ' idea'
1928 id ' maven-publish'
2029 id ' jacoco'
30+ id " com.jfrog.artifactory" version " 6.+"
2131 id ' signing'
2232}
2333
24- apply plugin : ' com.jfrog.artifactory'
25-
2634// set the java version
2735java {
28- sourceCompatibility = JavaVersion . VERSION_17
29- targetCompatibility = JavaVersion . VERSION_17
36+ sourceCompatibility = JavaVersion . VERSION_25
37+ targetCompatibility = JavaVersion . VERSION_25
3038 withJavadocJar()
3139 withSourcesJar()
3240}
3341
3442group = ' com.codingrodent.microprocessor'
3543
36- task setVersion {
37- if (System . env. BUILD_NUMBER ) {
38- version = projectVersionMajor + ' .' + projectVersionMinor + ' .' + System . env. BUILD_NUMBER
39- } else {
40- version = projectVersionMajor + ' .' + projectVersionMinor + ' .' + projectVersionBuild
41- }
42- }
43-
44+ def buildNum = System . getenv(" BUILD_NUMBER" )
45+ version = buildNum
46+ ? " ${ projectVersionMajor} .${ projectVersionMinor} .${ buildNum} "
47+ : " ${ projectVersionMajor} .${ projectVersionMinor} .${ projectVersionBuild} "
4448
4549jar {
46- baseName = projectName
50+ archiveBaseName = projectName
4751 manifest
4852 {
4953 attributes ' Implementation-Title' : projectName,
50- ' Implementation-Version' : version
54+ ' Implementation-Version' : archiveVersion
5155 }
5256}
5357
5458javadoc {
5559 options. addBooleanOption(' html5' , true )
5660}
5761
58-
59- artifacts {
60- archives sourcesJar
61- archives javadocJar
62- }
63-
6462repositories {
6563 mavenCentral()
6664}
6765
6866jacoco {
69- toolVersion = " 0.8.8 "
67+ toolVersion = " 0.8.14 "
7068}
7169
7270test {
@@ -77,53 +75,84 @@ test {
7775 includeTestsMatching " com.codingrodent.microprocessor.*"
7876 }
7977 jacoco {
80- destinationFile = file(" $b uildDir / jacoco/jacocoTest.exec" )
81- classDumpDir = file( " $b uildDir / jacoco/classpathdumps" )
78+ destinationFile = layout . buildDirectory . file(" jacoco/jacocoTest.exec" ). get() . asFile
79+ classDumpDir = layout . buildDirectory . dir( " jacoco/classpathdumps" ). get() . asFile
8280 }
8381}
8482
8583jacocoTestReport {
8684 reports {
87- xml. enabled true
88- csv. enabled false
89- html. destination file( " ${ buildDir } / jacocoHtml" )
85+ xml. required = true
86+ csv. required = false
87+ html. outputLocation = layout . buildDirectory . dir( " jacocoHtml" )
9088 }
9189}
9290
93-
9491spotbugs {
95- toolVersion = ' 4.7.2 '
92+ toolVersion = " 4.9.8 "
9693 ignoreFailures = false
97- effort = ' max'
94+ showProgress = true
95+ effort = Effort . MAX
96+ // reportLevel = Confidence.HIGH
97+ excludeFilter = file(" $rootProject . projectDir /excludeFilter.xml" )
9898}
9999
100+ spotbugsMain {
101+ reports. create(" html" ) {
102+ required = true
103+ }
104+ }
105+
106+ artifactory {
107+ contextUrl = " ${ artifactory_contextUrl} " // The base Artifactory URL if not overridden by the publisher/resolver
108+ publish {
109+ repository {
110+ repoKey = ' libs-release-local'
111+ username = " ${ artifactory_user} "
112+ password = " ${ artifactory_password} "
113+ }
114+ defaults {
115+ // Reference to Gradle publications defined in the build script.
116+ // This is how we tell the Artifactory Plugin which artifacts should be
117+ // published to Artifactory.
118+ publications(' mavenJava' )
119+ publishArtifacts = true
120+ // Properties to be attached to the published artifacts.
121+ properties = [' qa.level' : ' basic' , ' dev.team' : ' core' ]
122+ // Publish generated POM files to Artifactory (true by default)
123+ publishPom = true
124+ }
125+ }
126+ }
127+
128+
100129publishing {
101130 publications {
102131 mavenJava(MavenPublication ) {
103132 from components. java
104133 pom {
105- artifactId= ' Z80Processor'
106- groupId= ' com.codingrodent.microprocessor'
107- name= ' com.codingrodent.microprocessor.Z80Processor'
108- description= ' A Z80 Microprocessor core in Java'
109- url= ' https://github.com/codesqueak/Z80Processor'
134+ artifactId = ' Z80Processor'
135+ groupId = ' com.codingrodent.microprocessor'
136+ name = ' com.codingrodent.microprocessor.Z80Processor'
137+ description = ' A Z80 Microprocessor core in Java'
138+ url = ' https://github.com/codesqueak/Z80Processor'
110139 scm {
111- url= ' https://github.com/codesqueak/Z80Processor'
112- connection= ' scm:git:git://github.com/codesqueak/Z80Processor.git'
113- developerConnection= ' scm:git:ssh://github.com:codesqueak/Z80Processor.git'
140+ url = ' https://github.com/codesqueak/Z80Processor'
141+ connection = ' scm:git:git://github.com/codesqueak/Z80Processor.git'
142+ developerConnection = ' scm:git:ssh://github.com:codesqueak/Z80Processor.git'
114143 }
115144 licenses {
116145 license {
117- name= ' The Apache Software License, Version 2.0'
118- url= ' http://www.apache.org/licenses/LICENSE-2.0.txt'
119- distribution = ' repo'
146+ name = ' The Apache Software License, Version 2.0'
147+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
148+ distribution = ' repo'
120149 }
121150 }
122151 developers {
123152 developer {
124- id= ' codesqueak'
125- name= ' codesqueak'
126- organizationUrl = ' http://www.codesqueak.com'
153+ id = ' codesqueak'
154+ name = ' codesqueak'
155+ organizationUrl = ' http://www.codesqueak.com'
127156 // organization 'codesqueak'
128157 }
129158 }
@@ -136,44 +165,19 @@ signing {
136165 sign(publishing. publications[" mavenJava" ])
137166}
138167
139-
140- artifactory {
141- contextUrl = " ${ artifactory_contextUrl} " // The base Artifactory URL if not overridden by the publisher/resolver
142- publish {
143- repository {
144- repoKey = ' gradle-dev-local'
145- username = " ${ artifactory_user} "
146- password = " ${ artifactory_password} "
147- maven = true
148-
149- }
150- defaults {
151- // Reference to Gradle publications defined in the build script.
152- // This is how we tell the Artifactory Plugin which artifacts should be
153- // published to Artifactory.
154- publications(' mavenJava' )
155- publishArtifacts = true
156- // Properties to be attached to the published artifacts.
157- properties = [' qa.level' : ' basic' , ' dev.team' : ' core' ]
158- // Publish generated POM files to Artifactory (true by default)
159- publishPom = true
160- }
161- }
162- }
163-
164168// check.dependsOn jacocoTestReport
165169
166170dependencies {
167- implementation group : ' com.github.spotbugs' , name : ' spotbugs-annotations' , version : ' 4.7.2 '
171+ implementation( " com.github.spotbugs: spotbugs-annotations:4.9.8 " )
168172 //
169- testImplementation group : ' org.junit.jupiter' , name : ' junit-jupiter-api' , version : ' 5.9.1'
170- testImplementation group : ' org.junit.jupiter' , name : ' junit-jupiter-engine' , version : ' 5.9.1'
171- testImplementation group : ' org.mockito' , name : ' mockito-core' , version : ' 4.8.0'
172- testImplementation group : ' org.hamcrest' , name : ' hamcrest' , version : ' 2.2'
173+ testImplementation(" org.junit.jupiter:junit-jupiter-api:6.0.1" )
174+ testImplementation(" org.junit.jupiter:junit-jupiter-engine:6.0.1" )
175+ testImplementation(" org.junit.platform:junit-platform-launcher:6.0.1" )
176+ testImplementation(" org.mockito:mockito-core:5.20.0" )
177+ testImplementation(" org.hamcrest:hamcrest:3.0" )
173178}
174179
175-
176180wrapper {
177- gradleVersion = ' 7.5 .1'
181+ gradleVersion = ' 9.2 .1'
178182 distributionType = Wrapper.DistributionType . BIN
179183}
0 commit comments