Skip to content

Commit dc74429

Browse files
authored
Merge pull request #23 from shima004/master
feat: Upgrade to Java 21 and Gradle 9.3.1
2 parents a05c715 + 0772c70 commit dc74429

5 files changed

Lines changed: 27 additions & 26 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
## 1. Software Pre-Requisites
66

7-
* Git
8-
* OpenJDK Java 17
9-
* Gradle
7+
- Git
8+
- OpenJDK Java 21
9+
- Gradle
1010

1111
## 2. Download
1212

@@ -28,4 +28,4 @@ $ ./gradlew build
2828

2929
## 4. Support
3030

31-
To report a bug, suggest improvements or request support, please open an issue at GitHub <https://github.com/roborescue/adf-core-java/issues>.
31+
To report a bug, suggest improvements or request support, please open an issue at GitHub <https://github.com/roborescue/adf-core-java/issues>.

build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ defaultTasks 'build'
77

88
group = 'com.github.roborescue'
99

10-
sourceCompatibility = '17'
11-
targetCompatibility = '17'
12-
version = '4.0'
10+
java {
11+
sourceCompatibility = JavaVersion.VERSION_21
12+
targetCompatibility = JavaVersion.VERSION_21
13+
}
14+
version = '5.0'
1315

1416
def getDateTime() {
1517
new Date().format('yyyyMMddHHmmss', TimeZone.getTimeZone('UTC'))
@@ -42,7 +44,7 @@ repositories {
4244
url = 'https://repo.enonic.com/public/'
4345
}
4446
maven {
45-
url 'https://jitpack.io'
47+
url = 'https://jitpack.io'
4648
}
4749
}
4850

@@ -69,7 +71,7 @@ publishing {
6971
publications {
7072
maven(MavenPublication) {
7173
groupId = 'com.github.roborescue'
72-
artifactId = 'adf-core'
74+
artifactId = 'adf-core-java'
7375
version = 'master-SNAPSHOT'
7476

7577
from components.java
@@ -90,21 +92,19 @@ clean{
9092
}
9193

9294
task javadocJar(type: Jar, dependsOn: javadoc) {
93-
classifier = 'javadoc'
95+
archiveClassifier = 'javadoc'
9496
from javadoc.destinationDir
9597
archiveFileName = 'adf-core-javadoc.jar'
9698
}
9799

98100
task sourcesJar(type: Jar, dependsOn: classes) {
99-
classifier = 'sources'
101+
archiveClassifier = 'sources'
100102
from sourceSets.main.allSource
101103
archiveFileName = 'adf-core-sources.jar'
102104
}
103105

104-
artifacts {
105-
archives sourcesJar
106-
archives javadocJar
107-
}
106+
assemble.dependsOn sourcesJar
107+
assemble.dependsOn javadocJar
108108

109109
task start (type: JavaExec) {
110110
classpath = sourceSets.main.runtimeClasspath
@@ -113,4 +113,4 @@ task start (type: JavaExec) {
113113
args project.args.split('\\s+')
114114
}
115115
jvmArgs '-Xms512m', '-Xmx8g'
116-
}
116+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

jitpack.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
before_install:
2-
- source "$HOME/.sdkman/bin/sdkman-init.sh"
3-
- sdk update
4-
- sdk install java 17.0.1-tem
5-
- sdk use java 17.0.1-tem
1+
jdk:
2+
- openjdk21
3+
install:
4+
- ./gradlew publishToMavenLocal -Dmaven.repo.local=$HOME/.m2/repository

src/main/java/adf/core/launcher/ConsoleOutput.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package adf.core.launcher;
22

33
import static adf.core.Main.VERSION_CODE;
4-
import adf.core.Main;
4+
55
import java.io.IOException;
6-
import java.net.URL;
6+
import java.net.URI;
77
import java.util.concurrent.Semaphore;
88
import java.util.jar.Attributes;
99
import java.util.jar.Manifest;
1010

11+
import adf.core.Main;
12+
1113
public class ConsoleOutput {
1214

1315
private static final int titleLength = 6;
@@ -112,12 +114,12 @@ private static String getTimestamp() {
112114
String manifestPath = classPath.substring(0, classPath.lastIndexOf("!") + 1)
113115
+ "/META-INF/MANIFEST.MF";
114116
try {
115-
Manifest manifest = new Manifest(new URL(manifestPath).openStream());
117+
Manifest manifest = new Manifest(URI.create(manifestPath).toURL().openStream());
116118
Attributes attributes = manifest.getMainAttributes();
117119
buildTimestamp = attributes.getValue("Build-Timestamp");
118120
} catch (IOException e) {
119121
}
120122

121123
return buildTimestamp;
122124
}
123-
}
125+
}

0 commit comments

Comments
 (0)