This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
130 lines (109 loc) · 5.02 KB
/
justfile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# -------------------------------------------------
# Internal Helpers
message := "echo -e \"\n==> \""
rustdir := "cd rust;"
godotdir := "cd godot;"
android_keystore := "secrets/debug.keystore"
# -------------------------------------------------
# Build and export binaries for different platforms
# Sometimes there are 'same' commands, but for different OS
[linux]
linux-debug:
{{rustdir}} cargo build
{{godotdir}} godot --headless --export-debug "Linux/X11" "../export/linux/Godot Spike.x86_64"
[linux]
linux-release:
{{rustdir}} cargo build
{{rustdir}} cargo build --release
{{godotdir}} godot --headless --export-release "Linux/X11" "../export/linux/Godot Spike.x86_64"
[linux]
android-debug:
{{rustdir}} cargo build
{{rustdir}} cargo build --target aarch64-linux-android --config target.aarch64-linux-android.linker=\"../dependencies/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android34-clang\"
{{godotdir}} godot --headless --export-debug "Android" "../export/android/Godot Spike.apk"
[linux]
android-release:
{{rustdir}} cargo build
{{rustdir}} cargo build --release --target aarch64-linux-android --config target.aarch64-linux-android.linker=\"../dependencies/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android34-clang\"
{{godotdir}} godot --headless --export-release "Android" "../export/android/Godot Spike.apk"
[windows]
android-debug:
{{rustdir}} cargo build --target x86_64-pc-windows-msvc
{{rustdir}} cargo build --target aarch64-linux-android --config target.aarch64-linux-android.linker=\"../dependencies/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android34-clang.cmd\"
{{godotdir}} godot --headless --export-debug "Android" "../export/android/Godot Spike.apk"
[windows]
android-release:
{{rustdir}} cargo build --target x86_64-pc-windows-msvc
{{rustdir}} cargo build --release --target aarch64-linux-android --config target.aarch64-linux-android.linker=\"../dependencies/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android34-clang.cmd\"
{{godotdir}} godot --headless --export-release "Android" "../export/android/Godot Spike.apk"
[windows]
windows-debug:
{{rustdir}} cargo build --target x86_64-pc-windows-msvc
{{godotdir}} godot --headless --export-debug "Windows Desktop" "../export/windows/Godot Spike.exe"
[windows]
windows-release:
{{rustdir}} cargo build --target x86_64-pc-windows-msvc
{{rustdir}} cargo build --release --target x86_64-pc-windows-msvc
{{godotdir}} godot --headless --export-release "Windows Desktop" "../export/windows/Godot Spike.exe"
[macos]
macos-debug:
{{rustdir}} cargo build
{{godotdir}} godot --headless --export-debug "macOS" "../export/macos/Godot Spike.dmg"
[macos]
macos-release:
{{rustdir}} cargo build
{{rustdir}} cargo build --release
{{godotdir}} godot --headless --export-release "macOS" "../export/macos/Godot Spike.dmg"
[macos]
ios-debug:
# NOTE: can only work on MacOS with xcode
{{rustdir}} cargo build --target aarch64-apple-ios
{{godotdir}} godot --headless --export-debug "iOS" "../export/ios/Godot Spike.ipa"
[macos]
ios-release:
# NOTE: can only work on MacOS with xcode
{{rustdir}} cargo build --release --target aarch64-apple-ios
{{godotdir}} godot --headless --export-release "iOS" "../export/ios/Godot Spike.ipa"
# -------------------------------------------------
# Execute prior to development of project - installing rust dependencies
setup:
just _setup-verify-dependencies _setup-precommit _setup-rust setup-{{os()}}
# -------------------------------------------------
# Execute to verify if all dependencies are installed
_setup-verify-dependencies:
@ {{message}} "Verifying all required programs are installed...\nAll programs need to be in \$PATH!"
rustup --version
godot --version
gdformat --version
pre-commit --version
[windows]
[linux]
setup-android:
@ {{message}} "Installing Rust tools for Android builds..."
rustup target add aarch64-linux-android
cargo install cargo-ndk
@ {{message}} "Installing Android NDK & SDK in the dependencies folder..."
scripts/install-android-tools.sh
just _setup-debug-keystore
[windows]
setup-windows:
@ {{message}} "Installing Rust tools for Windows builds and setup for android export..."
rustup target add x86_64-pc-windows-gnu
[macos]
setup-macos:
@ {{message}} "Installing Rust tools for iOS builds..."
rustup target add aarch64-apple-ios
cargo install cargo-lipo
[linux]
setup-linux:
@ {{message}} "Setup Linux build tools..."
_setup-precommit:
@ {{message}} "Setting up pre-commit hooks..."
pre-commit install
_setup-rust:
rustup toolchain install stable
rustup default stable
_setup-debug-keystore:
@ {{message}} "Generating debug keypair for Android..."
test -f {{android_keystore}} \
|| keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore {{android_keystore}} -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999 -deststoretype pkcs12