Ah, android, such fun
This commit is contained in:
parent
26a47d2e51
commit
c95bcfa583
1 changed files with 16 additions and 0 deletions
|
@ -57,10 +57,26 @@ let
|
|||
|
||||
nix-shell --argstr run "./gradlew $@" "${gradle-fhs-nix}"
|
||||
'';
|
||||
|
||||
sign-release = pkgs.writeScriptBin "sign-release" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
|
||||
BUILD_TOOLS_PATH="${composed.androidsdk}/libexec/android-sdk/build-tools/28.0.3"
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
||||
APK_DIR="$REPO_ROOT/app/build/outputs/apk/release"
|
||||
|
||||
rm "$APK_DIR/app-release-unsigned-aligned.apk"
|
||||
rm "$APK_DIR/app-release.apk"
|
||||
"$BUILD_TOOLS_PATH/zipalign" -v -p 4 "$APK_DIR/app-release-unsigned.apk" "$APK_DIR/app-release-unsigned-aligned.apk"
|
||||
|
||||
"$BUILD_TOOLS_PATH/apksigner" sign --ks "$REPO_ROOT/keystore.jks" --out "$APK_DIR/app-release.apk" "$APK_DIR/app-release-unsigned-aligned.apk"
|
||||
"$BUILD_TOOLS_PATH/apksigner" verify "$APK_DIR/app-release.apk"
|
||||
'';
|
||||
in
|
||||
pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
gradle-run-script
|
||||
sign-release
|
||||
jdk11
|
||||
jdtls
|
||||
(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue