forked from amber-lang/amber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ab
32 lines (30 loc) · 1.13 KB
/
build.ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
let targets = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-musl",
"x86_64-apple-darwin",
"x86_64-unknown-linux-musl"
]
// Check if such directory exists
$test -f "Cargo.toml" > /dev/null$ failed {
echo "Please run this command in the project root directory"
unsafe $exit 1$
}
unsafe {
if status == 0 {
let target_str = ""
loop target in targets {
target_str += "--target {target} "
}
$cargo build --release {target_str}$
// Move ambers to the release directory
$mv target/aarch64-apple-darwin/release/amber target/release/amber_macos_aarch64$
$mv target/aarch64-unknown-linux-musl/release/amber target/release/amber_linux_aarch64$
$mv target/x86_64-apple-darwin/release/amber target/release/amber_macos_x86_64$
$mv target/x86_64-unknown-linux-musl/release/amber target/release/amber_linux_x86_64$
// Recompile installer scripts
$cargo run -- setup/install.ab setup/install.sh$
$cargo run -- setup/uninstall.ab setup/uninstall.sh$
} else {
echo "Please run this command in the project root directory"
}
}