Skip to content

Commit b549fa9

Browse files
authored
Merge pull request #18 from codesqueak/Java25Update
Java25 update
2 parents 35e591d + e2dfa42 commit b549fa9

27 files changed

+434
-370
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ jobs:
3434
- name: Checkout repository
3535
uses: actions/checkout@v2
3636

37-
# Install and setup JDK 17
38-
- name: Setup JDK 17
37+
# Install and setup JDK 25
38+
- name: Setup JDK 25
3939
uses: actions/setup-java@v2
4040
with:
4141
distribution: 'temurin'
42-
java-version: '17'
42+
java-version: '25'
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
@@ -56,16 +56,17 @@ jobs:
5656
- name: Autobuild
5757
uses: github/codeql-action/autobuild@v4
5858

59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 https://git.io/JvXDl
59+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
60+
# If this step fails, then you should remove it and run the build manually (see below)
61+
- name: Autobuild
62+
uses: github/codeql-action/autobuild@v4
6163

62-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63-
# and modify them (or add more) to build your code if your project
64-
# uses a compiled language
64+
# ℹ️ Command-line programs to run using the OS shell.
65+
# 📚 https://git.io/JvXDl
6566

66-
#- run: |
67-
# make bootstrap
68-
# make release
67+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
68+
# and modify them (or add more) to build your code if your project
69+
# uses a compiled language
6970

7071
- name: Perform CodeQL Analysis
7172
uses: github/codeql-action/analyze@v4

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19-
- name: Set up JDK 17
19+
- name: Set up JDK 25
2020
uses: actions/setup-java@v2
2121
with:
2222
distribution: 'temurin'
23-
java-version: '17'
23+
java-version: '25'
2424
- name: Grant execute permission for gradlew
2525
run: chmod +x gradlew
2626
- name: Build with Gradle

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The build may take a few minutes as it includes a comprehensive test suite for t
3030

3131
## Java Version
3232

33-
Version 4.0.0 onwards of the emulator require Java 17 or above
33+
Version 5.0.0 onwards of the emulator require Java 25 or above
3434

3535
### Include Using Maven
3636

@@ -39,15 +39,15 @@ Version 4.0.0 onwards of the emulator require Java 17 or above
3939
<dependency>
4040
<groupId>com.codingrodent.microprocessor</groupId>
4141
<artifactId>Z80Processor</artifactId>
42-
<version>4.2.0</version>
42+
<version>5.0.0</version>
4343
</dependency>
4444
```
4545

4646
### Include Using Gradle
4747

4848
```
4949
// https://mvnrepository.com/artifact/com.codingrodent.microprocessor/Z80Processor
50-
compile group: 'com.codingrodent.microprocessor', name: 'Z80Processor', version: '4.2.0'
50+
compile group: 'com.codingrodent.microprocessor', name: 'Z80Processor', version: '5.0.0'
5151
```
5252

5353
## Undocumented instruction

build.gradle

Lines changed: 82 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,70 @@
1+
import com.github.spotbugs.snom.Effort
2+
3+
14
buildscript {
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

1524
plugins {
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
2735
java {
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

3442
group = '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

4549
jar {
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

5458
javadoc {
5559
options.addBooleanOption('html5', true)
5660
}
5761

58-
59-
artifacts {
60-
archives sourcesJar
61-
archives javadocJar
62-
}
63-
6462
repositories {
6563
mavenCentral()
6664
}
6765

6866
jacoco {
69-
toolVersion = "0.8.8"
67+
toolVersion = "0.8.14"
7068
}
7169

7270
test {
@@ -77,53 +75,84 @@ test {
7775
includeTestsMatching "com.codingrodent.microprocessor.*"
7876
}
7977
jacoco {
80-
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
81-
classDumpDir = file("$buildDir/jacoco/classpathdumps")
78+
destinationFile = layout.buildDirectory.file("jacoco/jacocoTest.exec").get().asFile
79+
classDumpDir = layout.buildDirectory.dir("jacoco/classpathdumps").get().asFile
8280
}
8381
}
8482

8583
jacocoTestReport {
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-
9491
spotbugs {
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+
100129
publishing {
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

166170
dependencies {
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-
176180
wrapper {
177-
gradleVersion = '7.5.1'
181+
gradleVersion = '9.2.1'
178182
distributionType = Wrapper.DistributionType.BIN
179183
}

excludeFilter.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<FindBugsFilter>
3+
<Match>
4+
<Or>
5+
<Bug code="EI, EI2" />
6+
</Or>
7+
</Match>
8+
</FindBugsFilter>

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#
44
projectName=Z80Processor
55
#
6-
projectVersionMajor=4
7-
projectVersionMinor=2
6+
projectVersionMajor=5
7+
projectVersionMinor=0
88
projectVersionBuild=0
99
#
1010
artifactory_user=admin
1111
artifactory_password=secret
12-
artifactory_contextUrl=http://localhost:9081/artifactory
12+
artifactory_contextUrl=http://localhost:8081/artifactory

gradle/wrapper/gradle-wrapper.jar

-13.9 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)