ソースを参照

darkwallet: Add standalone apk build target; force default Rust toolchain

parazyd 1 年間 前
コミット
778b79a2a9
3 ファイル変更27 行追加7 行削除
  1. 1 2
      bin/darkwallet/Dockerfile
  2. 24 5
      bin/darkwallet/Makefile
  3. 2 0
      bin/darkwallet/rust-toolchain.toml

+ 1 - 2
bin/darkwallet/Dockerfile

@@ -10,7 +10,7 @@ ENV RUSTUP_HOME=/usr/local/rustup \
 
 RUN curl -o rustup.sh --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs
 RUN chmod +x rustup.sh
-RUN ./rustup.sh -y --default-toolchain nightly
+RUN ./rustup.sh -y --default-toolchain nightly-2024-09-30
 
 #RUN rustup toolchain install nightly
 #RUN rustup default nightly
@@ -61,4 +61,3 @@ RUN cargo install --path /root/cargo-apk
 
 # Add build-tools to PATH, for apksigner
 ENV PATH="/opt/android-sdk-linux/build-tools/31.0.0/:${PATH}"
-

+ 24 - 5
bin/darkwallet/Makefile

@@ -1,20 +1,37 @@
-default: fonts
+.POSIX:
+
+APK = target/android-artifacts/release/apk/darkwallet.apk
+
+SRC = \
+	build.rs \
+	Cargo.lock \
+	Cargo.toml \
+	Dockerfile \
+	$(shell find assets -type f) \
+	$(shell find src -type f) \
+	$(shell find res -type f)
+
+all: $(SRC) fonts
 	cargo lbuild
 	mv target/debug/darkwallet .
 	./darkwallet
 
+darkwallet.apk: $(SRC) fonts
+	podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/darkwallet/ -t apk cargo quad-apk build --release
+	cp -f $(APK) $@
+
 ibm-plex-mono-regular.otf:
-	wget https://codeberg.org/darkrenaissance/darkfi/raw/branch/data/ibm-plex-mono-regular.otf
+	wget -c https://codeberg.org/darkrenaissance/darkfi/raw/branch/data/ibm-plex-mono-regular.otf
 
 NotoColorEmoji.ttf:
-	wget https://codeberg.org/darkrenaissance/darkfi/raw/branch/data/NotoColorEmoji.ttf
+	wget -c https://codeberg.org/darkrenaissance/darkfi/raw/branch/data/NotoColorEmoji.ttf
 
 fonts: ibm-plex-mono-regular.otf NotoColorEmoji.ttf
 
-android: fonts
+android: $(SRC) fonts
 	podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/darkwallet/ -t apk cargo quad-apk build --release
 	adb uninstall darkfi.darkwallet
-	adb install target/android-artifacts/release/apk/darkwallet.apk
+	adb install $(APK)
 	reset
 	adb logcat -c
 	adb logcat -s darkfi
@@ -25,4 +42,6 @@ cli:
 
 clean:
 	podman run -v $(shell pwd):/root/dw -w /root/dw -t apk rm -fr target/
+	rm -f darkwallet.apk
 
+.PHONY: all android cli clean

+ 2 - 0
bin/darkwallet/rust-toolchain.toml

@@ -0,0 +1,2 @@
+[toolchain]
+channel = "nightly-2024-09-30"