Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

# Install and setup JDK 17
- name: Setup JDK 17
# Install and setup JDK 25
- name: Setup JDK 25
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
java-version: '25'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -56,16 +56,17 @@ jobs:
- name: Autobuild
uses: github/codeql-action/autobuild@v4

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

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

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up JDK 25
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
java-version: '25'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The build may take a few minutes as it includes a comprehensive test suite for t

## Java Version

Version 4.0.0 onwards of the emulator require Java 17 or above
Version 5.0.0 onwards of the emulator require Java 25 or above

### Include Using Maven

Expand All @@ -39,15 +39,15 @@ Version 4.0.0 onwards of the emulator require Java 17 or above
<dependency>
<groupId>com.codingrodent.microprocessor</groupId>
<artifactId>Z80Processor</artifactId>
<version>4.2.0</version>
<version>5.0.0</version>
</dependency>
```

### Include Using Gradle

```
// https://mvnrepository.com/artifact/com.codingrodent.microprocessor/Z80Processor
compile group: 'com.codingrodent.microprocessor', name: 'Z80Processor', version: '4.2.0'
compile group: 'com.codingrodent.microprocessor', name: 'Z80Processor', version: '5.0.0'
```

## Undocumented instruction
Expand Down
160 changes: 82 additions & 78 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,72 +1,70 @@
import com.github.spotbugs.snom.Effort


buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
url = "http://localhost:8081/artifactory/libs-release-local"
allowInsecureProtocol = true
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}

dependencies {
//Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.+')
classpath("org.jfrog.buildinfo:build-info-extractor-gradle:6.+")
}
}

plugins {
id "com.github.spotbugs" version "5.0.12"
id "com.github.spotbugs" version "6.2.5"
id 'java'
id 'idea'
id 'maven-publish'
id 'jacoco'
id "com.jfrog.artifactory" version "6.+"
id 'signing'
}

apply plugin: 'com.jfrog.artifactory'

// set the java version
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
withJavadocJar()
withSourcesJar()
}

group = 'com.codingrodent.microprocessor'

task setVersion {
if (System.env.BUILD_NUMBER) {
version = projectVersionMajor + '.' + projectVersionMinor + '.' + System.env.BUILD_NUMBER
} else {
version = projectVersionMajor + '.' + projectVersionMinor + '.' + projectVersionBuild
}
}

def buildNum = System.getenv("BUILD_NUMBER")
version = buildNum
? "${projectVersionMajor}.${projectVersionMinor}.${buildNum}"
: "${projectVersionMajor}.${projectVersionMinor}.${projectVersionBuild}"

jar {
baseName = projectName
archiveBaseName = projectName
manifest
{
attributes 'Implementation-Title': projectName,
'Implementation-Version': version
'Implementation-Version': archiveVersion
}
}

javadoc {
options.addBooleanOption('html5', true)
}


artifacts {
archives sourcesJar
archives javadocJar
}

repositories {
mavenCentral()
}

jacoco {
toolVersion = "0.8.8"
toolVersion = "0.8.14"
}

test {
Expand All @@ -77,53 +75,84 @@ test {
includeTestsMatching "com.codingrodent.microprocessor.*"
}
jacoco {
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpDir = file("$buildDir/jacoco/classpathdumps")
destinationFile = layout.buildDirectory.file("jacoco/jacocoTest.exec").get().asFile
classDumpDir = layout.buildDirectory.dir("jacoco/classpathdumps").get().asFile
}
}

jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir("jacocoHtml")
}
}


spotbugs {
toolVersion = '4.7.2'
toolVersion = "4.9.8"
ignoreFailures = false
effort = 'max'
showProgress = true
effort = Effort.MAX
// reportLevel = Confidence.HIGH
excludeFilter = file("$rootProject.projectDir/excludeFilter.xml")
}

spotbugsMain {
reports.create("html") {
required = true
}
}

artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'libs-release-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
}
defaults {
// Reference to Gradle publications defined in the build script.
// This is how we tell the Artifactory Plugin which artifacts should be
// published to Artifactory.
publications('mavenJava')
publishArtifacts = true
// Properties to be attached to the published artifacts.
properties = ['qa.level': 'basic', 'dev.team': 'core']
// Publish generated POM files to Artifactory (true by default)
publishPom = true
}
}
}


publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
artifactId= 'Z80Processor'
groupId= 'com.codingrodent.microprocessor'
name= 'com.codingrodent.microprocessor.Z80Processor'
description= 'A Z80 Microprocessor core in Java'
url= 'https://github.com/codesqueak/Z80Processor'
artifactId = 'Z80Processor'
groupId = 'com.codingrodent.microprocessor'
name = 'com.codingrodent.microprocessor.Z80Processor'
description = 'A Z80 Microprocessor core in Java'
url = 'https://github.com/codesqueak/Z80Processor'
scm {
url= 'https://github.com/codesqueak/Z80Processor'
connection= 'scm:git:git://github.com/codesqueak/Z80Processor.git'
developerConnection= 'scm:git:ssh://github.com:codesqueak/Z80Processor.git'
url = 'https://github.com/codesqueak/Z80Processor'
connection = 'scm:git:git://github.com/codesqueak/Z80Processor.git'
developerConnection = 'scm:git:ssh://github.com:codesqueak/Z80Processor.git'
}
licenses {
license {
name= 'The Apache Software License, Version 2.0'
url= 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution ='repo'
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id= 'codesqueak'
name= 'codesqueak'
organizationUrl ='http://www.codesqueak.com'
id = 'codesqueak'
name = 'codesqueak'
organizationUrl = 'http://www.codesqueak.com'
// organization 'codesqueak'
}
}
Expand All @@ -136,44 +165,19 @@ signing {
sign(publishing.publications["mavenJava"])
}


artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'gradle-dev-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true

}
defaults {
// Reference to Gradle publications defined in the build script.
// This is how we tell the Artifactory Plugin which artifacts should be
// published to Artifactory.
publications('mavenJava')
publishArtifacts = true
// Properties to be attached to the published artifacts.
properties = ['qa.level': 'basic', 'dev.team': 'core']
// Publish generated POM files to Artifactory (true by default)
publishPom = true
}
}
}

// check.dependsOn jacocoTestReport

dependencies {
implementation group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: '4.7.2'
implementation("com.github.spotbugs:spotbugs-annotations:4.9.8")
//
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.1'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.8.0'
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
testImplementation("org.junit.jupiter:junit-jupiter-api:6.0.1")
testImplementation("org.junit.jupiter:junit-jupiter-engine:6.0.1")
testImplementation("org.junit.platform:junit-platform-launcher:6.0.1")
testImplementation("org.mockito:mockito-core:5.20.0")
testImplementation("org.hamcrest:hamcrest:3.0")
}


wrapper {
gradleVersion = '7.5.1'
gradleVersion = '9.2.1'
distributionType = Wrapper.DistributionType.BIN
}
8 changes: 8 additions & 0 deletions excludeFilter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Or>
<Bug code="EI, EI2" />
</Or>
</Match>
</FindBugsFilter>
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#
projectName=Z80Processor
#
projectVersionMajor=4
projectVersionMinor=2
projectVersionMajor=5
projectVersionMinor=0
projectVersionBuild=0
#
artifactory_user=admin
artifactory_password=secret
artifactory_contextUrl=http://localhost:9081/artifactory
artifactory_contextUrl=http://localhost:8081/artifactory
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading