Skip to content

Commit

Permalink
Merge pull request #18 from fizzed/feature/blaze-1.5
Browse files Browse the repository at this point in the history
Feature/blaze 1.5
  • Loading branch information
jjlauer authored Nov 4, 2023
2 parents e3fa0d8 + 37ff1ad commit 021ebd6
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .blaze/blaze.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blaze.dependencies = [
"com.fizzed:jne:4.1.1"
]

java.source.version = 8
90 changes: 90 additions & 0 deletions .blaze/blaze.java
Original file line number Diff line number Diff line change
@@ -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<JavaHome> 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));
}

}
69 changes: 69 additions & 0 deletions .blaze/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>blaze</groupId>
<artifactId>bigmap-blaze</artifactId>
<version>0.0.1</version>

<!--
THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT BY HAND!
Edit or create a <blaze-script>.conf file, and re-run the generate-maven-project command.
-->

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<build>
<sourceDirectory>${project.basedir}</sourceDirectory>
</build>
<dependencies>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-ivy</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-core</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.zeroturnaround</groupId>
<artifactId>zt-exec</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>jne</artifactId>
<version>4.1.1</version>
</dependency>
</dependencies>
</project>
17 changes: 17 additions & 0 deletions .github/workflows/java21.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/macos-x64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file added blaze.jar
Binary file not shown.
25 changes: 6 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

<properties>
<java.version>1.8</java.version>
<tokyocabinet.version>0.0.14</tokyocabinet.version>
<tkrzw.version>0.0.7</tkrzw.version>
<tokyocabinet.version>0.0.15</tokyocabinet.version>
<tkrzw.version>0.0.8</tkrzw.version>
</properties>

<scm>
Expand Down Expand Up @@ -43,12 +43,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.2.1</version>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -122,15 +122,15 @@
<dependency>
<groupId>org.rocksdb</groupId>
<artifactId>rocksdbjni</artifactId>
<version>7.8.3</version>
<version>8.3.2</version>
</dependency>

<!-- testing -->

<dependency>
<groupId>com.fizzed</groupId>
<artifactId>crux-util</artifactId>
<version>1.0.13</version>
<version>1.0.40</version>
</dependency>

<dependency>
Expand All @@ -145,24 +145,11 @@
<version>2.0.0.0</version>
</dependency>

<!--<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
</dependency>-->

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.1</version>
</dependency>

<!-- only if junit4 is present -->
<!--<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.8.1</version>
</dependency>-->

<dependency>
<groupId>org.mockito</groupId>
Expand Down

0 comments on commit 021ebd6

Please sign in to comment.