mirror of
https://github.com/status-im/status-react.git
synced 2025-01-11 11:34:45 +00:00
Jakub Sokołowski
f2c96dcd3b
Changes: * Create `nix/config.nix` with `config` defaults * Add `nix/tools/gradlePropParser.nix` for reading `gradle.properties` * Add `nix/mobile/android/keystore.nix` for generating a keystore * Load keystore generation in `nix/mobile/android/default.nix` * Use generated keystore if it's not provided via `config` * Add `-deststoretype pkcs12` in `scripts/generate-keystore.sh` * Add `nix/lib/assertEnvVarSet.nix` for checking if env var is set Signed-off-by: Jakub Sokołowski <jakub@status.im>
21 lines
605 B
Nix
21 lines
605 B
Nix
# Parser for android/gradle.properties file.
|
|
# Returns an attrset with keys and values from it.
|
|
{ lib }:
|
|
|
|
gradlePropsFile:
|
|
|
|
let
|
|
inherit (lib) head last filter listToAttrs splitString nameValuePair hasPrefix readFile;
|
|
|
|
# Read lines
|
|
lines = splitString "\n" (readFile gradlePropsFile);
|
|
|
|
isKeyValueLine = line: line != "" && !hasPrefix "#" line;
|
|
cleanup = lines: filter isKeyValueLine lines;
|
|
extractKeyValues = line:
|
|
let flag = splitString "=" line;
|
|
in nameValuePair (head flag) (last flag);
|
|
parseAttrs = lines: listToAttrs (map extractKeyValues lines);
|
|
in
|
|
parseAttrs (cleanup lines)
|