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
4 changes: 2 additions & 2 deletions android-application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ android {
compileOptions {
// Gradle 9/10 require modern Java versions (Java 17 or Java 21) for the build environment,
// but you can still target Java 8 or Java 11 for Android compatibility.
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
}

// Updated: packagingOptions is deprecated and removed in AGP 9.0+. Use packaging instead.
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
50 changes: 33 additions & 17 deletions helper-scripts/abstract/abstract-sonatype-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,39 @@ function generateGenericPom() {
}

function publishBuild() {
local artifactId=$1
local artifact=$2
local version=$3
local javadoc_jar=$4
local sources_jar=$5
local pomFile=$6
local groupId="$1"
local artifactId="$2"
local artifact="$3"
local version="$4"
local javadoc_jar="$5"
local sources_jar="$6"
local pomFile="$7"

${maven_bin} gpg:sign-and-deploy-file -s ${settings} -Durl=${sonatype_url} \
-DartifactId=${artifactId} \
-DrepositoryId=${repository} \
-Dversion=${version} \
-DpomFile=${pomFile} \
-Dgpg.passphrase=${passphrase} \
-Dfile=${artifact} \
-Djavadoc=${javadoc_jar} \
-Dsources=${sources_jar}
: "${CENTRAL_TOKEN_USERNAME:?Missing Central token username}"
: "${CENTRAL_TOKEN_PASSWORD:?Missing Central token password}"

# Upload and sign the main JAR, sources, Javadoc, and POM.
"${maven_bin}" gpg:sign-and-deploy-file \
-s "${settings}" \
-Durl="${sonatype_url}" \
-DgroupId="${groupId}" \
-DartifactId="${artifactId}" \
-Dversion="${version}" \
-DrepositoryId="${repository}" \
-DpomFile="${pomFile}" \
-Dfile="${artifact}" \
-Djavadoc="${javadoc_jar}" \
-Dsources="${sources_jar}" \
-Dgpg.passphrase="${passphrase}" || return $?

return $?
}
# Transfer the uploaded deployment to the Central Publisher Portal.
local token
token=$(printf '%s:%s' \
"${CENTRAL_TOKEN_USERNAME}" \
"${CENTRAL_TOKEN_PASSWORD}" | base64 | tr -d '\n') || return $?

curl --fail-with-body --silent --show-error \
--request POST \
--header "Authorization: Bearer ${token}" \
"https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${groupId}?publishing_type=user_managed"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source "./helper-scripts/project-impl/variables.sh"

function downloadMavenLatest() {
wget "https://dlcdn.apache.org/maven/maven-3/${maven_version}/binaries/apache-maven-${maven_version}-bin.tar.gz"
wget "https://archive.apache.org/dist/maven/maven-3/${maven_version}/binaries/apache-maven-${maven_version}-bin.tar.gz"
return $?
}

Expand Down
6 changes: 3 additions & 3 deletions helper-scripts/project-impl/publishing/maven-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_USERNAME}</username>
<password>${env.OSSRH_TOKEN}</password>
<id>central</id>
<username>${env.CENTRAL_TOKEN_USERNAME}</username>
<password>${env.CENTRAL_TOKEN_PASSWORD}</password>
</server>
</servers>
</settings>
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ generateGenericPom ${groupId} ${desktop_artifactId_release} ${version} "${deskto
cat "${desktop_pomFile}"

# publish 'android' and 'desktop' builds to maven sonatype
publishBuild "${desktop_artifactId_release}" "${desktop_artifact}" "${version}" "${javadoc_jar}" "${sources_jar}" "${desktop_pomFile}"
publishBuild "${groupId}" "${desktop_artifactId_release}" "${desktop_artifact}" "${version}" "${javadoc_jar}" "${sources_jar}" "${desktop_pomFile}"
4 changes: 2 additions & 2 deletions helper-scripts/project-impl/variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# Maven sonatype stuff
# ---------------------
sonatype_url="https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
repository="ossrh"
sonatype_url="https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
repository="central"
groupId="io.github.electrostat-lab"
maven_version="3.9.4"
maven_bin="./apache-maven-$maven_version/bin/mvn"
Expand Down
5 changes: 5 additions & 0 deletions snaploader-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,8 @@ dependencies {
runtimeOnly 'com.github.stephengold:jolt-jni-Windows64_avx2:6.1.1:DebugSp'
runtimeOnly 'io.github.software-hardware-codesign:jme3-alloc-desktop:1.0.0-pre-gamma-2'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
8 changes: 8 additions & 0 deletions snaploader-examples/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module electrostatic4j.snaploader.examples {
requires electrostatic4j.snaploader;
requires java.logging;
requires java.base;
requires com.github.stephengold.joltjni;

exports electrostatic4j.snaploader.examples;
}
7 changes: 3 additions & 4 deletions snaploader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tasks.register("generateSourcesJar", Jar) {
tasks.withType(JavaCompile).configureEach {
// Updated: In Gradle 9+, compiler options (like release) use lazy Property types.
// They must be assigned via .set() rather than raw assignment.
options.release.set(8)
options.release.set(9)
}

jar {
Expand All @@ -36,8 +36,7 @@ dependencies {
// Standardized api configuration notation for Gradle 9/10
api 'com.github.oshi:oshi-core:7.7.0'
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, The Electrostatic-Sandbox Distributed Simulation Framework, jSnapLoader
* Copyright (c) 2023-2026, The Electrostatic-Sandbox Distributed Simulation Framework, jSnapLoader
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -171,9 +171,10 @@ public void extract() throws FileExtractionProcessingException, FilesystemResour
try {
close();
} catch (Exception ex) {
throw new FilesystemResourceScavengingException();
throw new FilesystemResourceScavengingException(
"Failed to close the file extractor handler #" + getHashKey(), e);
}
throw new FileExtractionProcessingException("", e);
throw new FileExtractionProcessingException("Error while extracting the file #" + getHashKey(), e);
// release the native resources anyway!
} finally {
if (fileExtractionListener != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, The Electrostatic-Sandbox Distributed Simulation Framework, jSnapLoader
* Copyright (c) 2023-2026, The Electrostatic-Sandbox Distributed Simulation Framework, jSnapLoader
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -142,11 +142,11 @@ public void initialize(int size) throws FilesystemResourceInitializationExceptio
try {
close();
} catch (IOException ex) {
throw new FilesystemResourceScavengingException("File locator resources closure failed!", ex);
throw new FilesystemResourceScavengingException("File locator resources closure failed #" + getHashKey(), ex);
}
// fire the failure listener when file localization fails and pass
// the causative exception
throw new FilesystemResourceInitializationException("File locator initialization failed!", e);
throw new FilesystemResourceInitializationException("File locator initialization failed #" + getHashKey(), e);
}
}

Expand Down
13 changes: 13 additions & 0 deletions snaploader/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module electrostatic4j.snaploader {
requires java.logging;
requires java.base;
requires com.github.oshi;

exports electrostatic4j.snaploader;
exports electrostatic4j.snaploader.filesystem;
exports electrostatic4j.snaploader.library;
exports electrostatic4j.snaploader.platform;
exports electrostatic4j.snaploader.platform.util;
exports electrostatic4j.snaploader.throwable;
exports electrostatic4j.snaploader.util;
}
Loading