Skip to content

Commit

Permalink
Cleanup build and test process
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlauer committed Oct 25, 2023
1 parent d089955 commit b6b08f5
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 389 deletions.
8 changes: 3 additions & 5 deletions .blaze/blaze.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
blaze.dependencies = [
"com.fizzed:blaze-ssh:1.1.0"
"com.fizzed:buildx:1.0.0"
"com.fizzed:jne:4.0.0"
]

container-prefix = jne
"com.fizzed:buildx:1.0.3"
"com.fizzed:jne:4.0.2"
]
70 changes: 28 additions & 42 deletions .blaze/blaze.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void test() throws Exception {
.run();
}

private final List<Target> targets = asList(
private final List<Target> crossTargets = asList(
//
// Linux
//
Expand All @@ -37,18 +37,18 @@ public void test() throws Exception {
.setTags("build")
.setContainerImage("fizzed/buildx:x64-ubuntu16-jdk11-buildx-linux-arm64"),

/*new Target("linux", "armhf")
new Target("linux", "armhf")
.setTags("build")
.setContainerImage("fizzed/buildx:amd64-ubuntu16-jdk11-cross-build"),
.setContainerImage("fizzed/buildx:x64-ubuntu16-jdk11-buildx-linux-armhf"),

new Target("linux", "armel")
.setTags("build")
.setContainerImage("fizzed/buildx:amd64-ubuntu16-jdk11-cross-build"),
.setContainerImage("fizzed/buildx:x64-ubuntu16-jdk11-buildx-linux-armel"),

// NOTE: ubuntu18 added support for riscv64
new Target("linux", "riscv64")
.setTags("build")
.setContainerImage("fizzed/buildx:amd64-ubuntu18-jdk11-cross-build"),*/
.setContainerImage("fizzed/buildx:x64-ubuntu18-jdk11-buildx-linux-riscv64"),

//
// Linux (w/ MUSL)
Expand All @@ -66,49 +66,49 @@ public void test() throws Exception {
// FreeBSD
//

/*new Target("freebsd", "x64")
new Target("freebsd", "x64")
.setTags("build", "test")
.setHost("bmh-build-x64-freebsd12-1"),

new Target("freebsd", "arm64")
.setTags("build", "test")
.setHost("bmh-build-arm64-freebsd13-1"),*/
.setHost("bmh-build-arm64-freebsd13-1"),

//
// OpenBSD
//

/*new Target("openbsd", "x64")
new Target("openbsd", "x64")
.setTags("build", "test")
.setHost("bmh-build-x64-openbsd67-1"),

new Target("openbsd", "arm64")
.setTags("build", "test")
.setHost("bmh-build-arm64-openbsd72-1"),*/
.setHost("bmh-build-arm64-openbsd72-1"),

//
// MacOS
//

/*new Target("macos", "x64")
new Target("macos", "x64")
.setTags("build", "test")
.setHost("bmh-build-x64-macos1013-1"),

new Target("macos", "arm64")
.setTags("build", "test")
.setHost("bmh-build-arm64-macos12-1"),*/
.setHost("bmh-build-arm64-macos12-1"),

//
// Windows
//

/*new Target("windows", "x64")
new Target("windows", "x64")
.setTags("build", "test")
.setHost("bmh-build-x64-win11-1"),

new Target("windows", "arm64")
.setTags("build")
.setHost("bmh-build-x64-win11-1"),*/
.setHost("bmh-build-x64-win11-1"),

//
// test-only containers
Expand Down Expand Up @@ -150,6 +150,10 @@ public void test() throws Exception {
.setTags("test")
.setHost("bmh-build-x64-win10-1"),

new Target("windows", "arm64", "win11")
.setTags("test")
.setHost("bmh-build-arm64-win11-1"),


new Target("linux_musl", "x64", "alpine3.11, jdk11")
.setTags("test")
Expand All @@ -162,12 +166,7 @@ public void test() throws Exception {
.setContainerImage("fizzed/buildx:arm64v8-alpine3.11-jdk11")

/*
new Target("windows", "arm64-test", "win11")
.setTags("test")
.setHost("bmh-build-arm64-win11-1")*/
*/

/*
new Target("linux", "armhf-test")
Expand All @@ -186,8 +185,6 @@ public void test() throws Exception {
.setTags("test")
.setContainerImage("fizzed/buildx:riscv64-ubuntu20-jdk19"),
new Target("windows", "x64-test", "win10")
.setTags("test")
.setHost("bmh-build-x64-win10-1"),
Expand All @@ -200,31 +197,20 @@ public void test() throws Exception {

@Task(order = 50)
public void cross_build_containers() throws Exception {
final String user = System.getenv("USER");
final String userId = exec("id", "-u", user).runCaptureOutput().toString();
new Buildx(targets)
.onlyWithContainers()
new Buildx(crossTargets)
.containersOnly()
.execute((target, project) -> {
String dockerFile = "setup/Dockerfile.linux";
if (target.getContainerImage().contains("alpine")) {
dockerFile = "setup/Dockerfile.linux_musl";
}

project.exec("docker", "build",
"-f", dockerFile,
"--build-arg", "FROM_IMAGE="+target.getContainerImage(),
"--build-arg", "USERID="+userId,
"--build-arg", "USERNAME="+user,
"-t", project.getContainerName(),
"setup")
.run();
// no customization needed
project.buildContainer(new ContainerBuilder()
//.setCache(false)
);
});
}

@Task(order = 51)
public void cross_build_natives() throws Exception {
new Buildx(targets)
.setTags("build")
new Buildx(crossTargets)
.tags("build")
.execute((target, project) -> {
String buildScript = "setup/build-native-lib-linux-action.sh";
if (target.getOs().equals("macos")) {
Expand All @@ -243,8 +229,8 @@ public void cross_build_natives() throws Exception {

@Task(order = 53)
public void cross_tests() throws Exception {
new Buildx(targets)
.setTags("test")
new Buildx(crossTargets)
.tags("test")
.execute((target, project) -> {
project.action("java", "-jar", "blaze.jar", "test")
.run();
Expand Down
4 changes: 2 additions & 2 deletions .blaze/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>buildx</artifactId>
<version>1.0.0</version>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>jne</artifactId>
<version>4.0.0</version>
<version>4.0.2</version>
</dependency>
</dependencies>

Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
.idea
*.iml
native/libhelloj/helloj/HelloLib.class
.temp-m2
.temp-ivy2
.buildx
.buildx-temp
15 changes: 0 additions & 15 deletions setup/Dockerfile.linux

This file was deleted.

10 changes: 0 additions & 10 deletions setup/Dockerfile.linux-cross-build

This file was deleted.

16 changes: 0 additions & 16 deletions setup/Dockerfile.linux_musl

This file was deleted.

6 changes: 0 additions & 6 deletions setup/blaze.conf

This file was deleted.

Binary file removed setup/blaze.jar
Binary file not shown.
Loading

0 comments on commit b6b08f5

Please sign in to comment.