Skip to content

Commit dcd0702

Browse files
committed
Add Taskfile
1 parent efec8af commit dcd0702

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Build files
22
/target
33

4+
# Taskfile
5+
.task/
6+
47
# IDE
58
.idea/
69

Taskfile.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 3
2+
3+
vars:
4+
BINARY_NAME: "swift-precompiler"
5+
6+
tasks:
7+
build-universal:
8+
desc: "Build universal binary"
9+
sources:
10+
- "src/**/*.rs"
11+
- "Cargo.toml"
12+
- "Cargo.lock"
13+
- "assets/**/*"
14+
generates:
15+
- "target/aarch64-apple-darwin/release/{{.BINARY_NAME}}"
16+
- "target/x86_64-apple-darwin/release/{{.BINARY_NAME}}"
17+
cmds:
18+
- |
19+
cargo build --release --target x86_64-apple-darwin
20+
cargo build --release --target aarch64-apple-darwin
21+
22+
lipo -create -output target/{{.BINARY_NAME}} target/x86_64-apple-darwin/release/{{.BINARY_NAME}} \
23+
target/aarch64-apple-darwin/release/{{.BINARY_NAME}}
24+
25+
create-brew-archive:
26+
desc: "Create archive for Homebrew"
27+
sources:
28+
- "target/{{.BINARY_NAME}}"
29+
generates:
30+
- "target/{{.BINARY_NAME}}.tar.gz"
31+
cmds:
32+
- |
33+
tar -czf target/{{.BINARY_NAME}}.tar.gz target/{{.BINARY_NAME}}
34+
sha256sum target/{{.BINARY_NAME}}.tar.gz

0 commit comments

Comments
 (0)