diff --git a/.blaze/blaze.conf b/.blaze/blaze.conf new file mode 100644 index 0000000..ee2682c --- /dev/null +++ b/.blaze/blaze.conf @@ -0,0 +1,5 @@ +blaze.dependencies = [ + "com.fizzed:jne:4.1.1" +] + +java.source.version = 8 \ No newline at end of file diff --git a/.blaze/blaze.java b/.blaze/blaze.java new file mode 100644 index 0000000..d476af6 --- /dev/null +++ b/.blaze/blaze.java @@ -0,0 +1,90 @@ +import com.fizzed.blaze.Config; +import com.fizzed.blaze.Contexts; +import com.fizzed.blaze.Task; +import com.fizzed.jne.HardwareArchitecture; +import com.fizzed.jne.JavaHome; +import com.fizzed.jne.JavaHomeFinder; +import org.slf4j.Logger; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +import static com.fizzed.blaze.Contexts.withBaseDir; +import static com.fizzed.blaze.Systems.exec; +import static java.util.Arrays.asList; +import static java.util.Optional.ofNullable; + +public class blaze { + + private final Logger log = Contexts.logger(); + private final Config config = Contexts.config(); + private final Path projectDir = withBaseDir("../").toAbsolutePath(); + + @Task(order = 1) + public void test() throws Exception { + final Integer jdkVersion = this.config.value("jdk.version", Integer.class).orNull(); + final HardwareArchitecture jdkArch = ofNullable(this.config.value("jdk.arch").orNull()) + .map(HardwareArchitecture::resolve) + .orElse(null); + + final long start = System.currentTimeMillis(); + final JavaHome jdkHome = new JavaHomeFinder() + .jdk() + .version(jdkVersion) + .hardwareArchitecture(jdkArch) + .preferredDistributions() + .sorted(jdkVersion != null || jdkArch != null) // sort if any criteria provided + .find(); + + log.info(""); + log.info("Detected {} (in {} ms)", jdkHome, (System.currentTimeMillis()-start)); + log.info(""); + + exec("mvn", "clean", "test") + .workingDir(this.projectDir) + .env("JAVA_HOME", jdkHome.getDirectory().toString()) + .verbose() + .run(); + } + + @Task(order = 2) + public void test_all_jdks() throws Exception { + // collect and find all the jdks we will test on + final List jdks = new ArrayList<>(); + for (int jdkVersion : asList(21, 17, 11, 8)) { + jdks.add(new JavaHomeFinder() + .jdk() + .version(jdkVersion) + .preferredDistributions() + .sorted() + .find()); + } + + log.info("Detected JDKs:"); + jdks.forEach(jdk -> log.info(" {}", jdk)); + + for (JavaHome jdk : jdks) { + try { + log.info(""); + log.info("Using JDK {}", jdk); + log.info(""); + + exec("mvn", "clean", "test") + .workingDir(this.projectDir) + .env("JAVA_HOME", jdk.getDirectory().toString()) + .verbose() + .run(); + } catch (Exception e) { + log.error(""); + log.error("Failed on JDK " + jdk); + log.error(""); + throw e; + } + } + + log.info("Success on JDKs:"); + jdks.forEach(jdk -> log.info(" {}", jdk)); + } + +} \ No newline at end of file diff --git a/.blaze/pom.xml b/.blaze/pom.xml new file mode 100644 index 0000000..cfa9dbe --- /dev/null +++ b/.blaze/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + blaze + bigmap-blaze + 0.0.1 + + + + + 8 + 8 + true + true + + + ${project.basedir} + + + + com.fizzed + blaze-ivy + 1.5.0 + + + commons-io + commons-io + 2.11.0 + + + org.slf4j + slf4j-api + 2.0.7 + + + com.typesafe + config + 1.3.0 + + + org.apache.ivy + ivy + 2.5.2 + + + com.fizzed + blaze-core + 1.5.0 + + + org.slf4j + slf4j-simple + 2.0.7 + + + org.zeroturnaround + zt-exec + 1.12 + + + com.fizzed + jne + 4.1.1 + + + \ No newline at end of file diff --git a/.github/workflows/java21.yaml b/.github/workflows/java21.yaml new file mode 100644 index 0000000..05c9642 --- /dev/null +++ b/.github/workflows/java21.yaml @@ -0,0 +1,17 @@ +name: Java 21 +on: + - push + - workflow_dispatch +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Azul JDK 21 + uses: actions/setup-java@v3 + with: + java-version: 21 + distribution: 'zulu' + cache: 'maven' + - name: Test in Maven + run: mvn --no-transfer-progress -B test \ No newline at end of file diff --git a/.github/workflows/macos-x64.yaml b/.github/workflows/macos-x64.yaml index d52bc72..4b6beb6 100644 --- a/.github/workflows/macos-x64.yaml +++ b/.github/workflows/macos-x64.yaml @@ -4,7 +4,7 @@ on: - workflow_dispatch jobs: build: - runs-on: macos-11 + runs-on: macos-latest steps: - uses: actions/checkout@v3 - name: Set up Azul JDK 11 diff --git a/README.md b/README.md index 2b3d462..5c2794c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Java 8](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java8.yaml?branch=master&label=Java%208&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java8.yaml) [![Java 11](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java11.yaml?branch=master&label=Java%2011&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java11.yaml) [![Java 17](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java17.yaml?branch=master&label=Java%2017&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java17.yaml) +[![Java 21](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java21.yaml?branch=master&label=Java%2021&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java21.yaml) [![Linux x64](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java11.yaml?branch=master&label=Linux%20x64&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java11.yaml) [![MacOS x64](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/macos-x64.yaml?branch=master&label=MacOS%20x64&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/macos-x64.yaml) diff --git a/blaze.jar b/blaze.jar new file mode 100644 index 0000000..5acc29e Binary files /dev/null and b/blaze.jar differ diff --git a/pom.xml b/pom.xml index cf437a1..1447081 100644 --- a/pom.xml +++ b/pom.xml @@ -13,8 +13,8 @@ 1.8 - 0.0.14 - 0.0.7 + 0.0.15 + 0.0.8 @@ -43,12 +43,12 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.1.2 org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M7 + 3.2.1 @@ -122,7 +122,7 @@ org.rocksdb rocksdbjni - 7.8.3 + 8.3.2 @@ -130,7 +130,7 @@ com.fizzed crux-util - 1.0.13 + 1.0.40 @@ -145,24 +145,11 @@ 2.0.0.0 - - org.junit.jupiter junit-jupiter 5.8.1 - - - org.mockito