Skip to content

Commit

Permalink
Working blaze build_natives script leveraging powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlauer committed Jan 21, 2025
1 parent c170a9a commit 70a1d33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 98 deletions.
15 changes: 8 additions & 7 deletions .blaze/blaze.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.nio.file.Path;
import java.util.List;
import java.util.ArrayList;
import java.util.stream.Collectors;

import static com.fizzed.blaze.Systems.*;
Expand All @@ -32,21 +33,21 @@ public void build_natives() throws Exception {
mkdir(targetDir).parents().run();
cp(globber(nativeDir, "*")).target(targetDir).recursive().debug().run();

final List<String> arguments = new ArrayList<>();
final String buildScript;
final String autoConfTarget;
if (nativeTarget.getOperatingSystem() == OperatingSystem.MACOS) {
buildScript = "setup/build-native-lib-macos-action.sh";
autoConfTarget = "";
arguments.addAll(asList(nativeTarget.toJneOsAbi(), nativeTarget.toJneArch()));
} else if (nativeTarget.getOperatingSystem() == OperatingSystem.WINDOWS) {
// buildScript = "setup/build-native-lib-windows-action.bat";
buildScript = "setup/build-native-lib-windows-action.ps1";
autoConfTarget = "";
buildScript = "powershell";
arguments.addAll(asList("setup/build-native-lib-windows-action.ps1", nativeTarget.toJneOsAbi(), nativeTarget.toJneArch()));
} else {
buildScript = "setup/build-native-lib-linux-action.sh";
autoConfTarget = nativeTarget.toAutoConfTarget();
arguments.addAll(asList(nativeTarget.toJneOsAbi(), nativeTarget.toJneArch(), nativeTarget.toAutoConfTarget()));
}

exec("powershell", buildScript, nativeTarget.toJneOsAbi(), nativeTarget.toJneArch(), autoConfTarget)
exec(buildScript)
.args(arguments.toArray(new Object[]{}))
.workingDir(this.projectDir)
.verbose()
.run();
Expand Down
91 changes: 0 additions & 91 deletions setup/build-native-lib-windows-action.bat

This file was deleted.

2 changes: 2 additions & 0 deletions setup/build-native-lib-windows-action.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#Requires -Version 5.0

$basedir = $PSScriptRoot
$project_dir = [IO.Path]::GetFullPath("$basedir\..")

Expand Down

0 comments on commit 70a1d33

Please sign in to comment.