2019-08-14 07:05:32 +00:00
|
|
|
{ config, stdenv, stdenvNoCC, target-os ? "android", callPackage, mkShell,
|
2019-09-13 13:45:24 +00:00
|
|
|
mkFilter, androidenv, fetchurl, flock, openjdk, nodejs, bash, maven, zlib,
|
2019-07-23 20:54:17 +00:00
|
|
|
status-go, localMavenRepoBuilder, projectNodePackage, jsbundle }:
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
platform = callPackage ../../platform.nix { inherit target-os; };
|
|
|
|
|
|
|
|
androidEnv = callPackage ./android-env.nix { inherit target-os openjdk; };
|
|
|
|
gradle = callPackage ./gradle.nix { };
|
|
|
|
|
2019-09-10 09:50:09 +00:00
|
|
|
# Import a patched version of watchman (important for sandboxed builds on macOS)
|
|
|
|
watchmanFactory = callPackage ./watchman.nix { };
|
|
|
|
|
2019-06-04 16:50:29 +00:00
|
|
|
# Import a local patched version of node_modules, together with a local version of the Maven repo
|
2019-08-06 16:16:51 +00:00
|
|
|
mavenAndNpmDeps = callPackage ./maven-and-npm-deps { inherit stdenv stdenvNoCC gradle bash nodejs zlib localMavenRepoBuilder mkFilter projectNodePackage; };
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
# TARGETS
|
2019-11-13 13:12:02 +00:00
|
|
|
release = callPackage ./targets/release-android.nix { inherit target-os config gradle mavenAndNpmDeps mkFilter nodejs jsbundle status-go zlib watchmanFactory; androidEnvShellHook = androidEnv.shellHook; };
|
2019-08-06 16:16:51 +00:00
|
|
|
generate-maven-and-npm-deps-shell = callPackage ./maven-and-npm-deps/maven/shell.nix { inherit mkShell gradle maven nodejs projectNodePackage status-go; androidEnvShellHook = androidEnv.shellHook; };
|
2019-06-04 16:50:29 +00:00
|
|
|
adb-shell = mkShell {
|
|
|
|
buildInputs = [ androidEnv.licensedAndroidEnv ];
|
|
|
|
inherit (androidEnv) shellHook;
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
inherit (androidEnv) androidComposition;
|
|
|
|
|
2019-09-13 13:45:24 +00:00
|
|
|
buildInputs = assert platform.targetAndroid; [
|
|
|
|
mavenAndNpmDeps.deriv
|
|
|
|
flock # used in reset-node_modules.sh
|
|
|
|
openjdk
|
|
|
|
gradle
|
|
|
|
];
|
2019-06-04 16:50:29 +00:00
|
|
|
shellHook =
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) catAttrs concatStrings;
|
|
|
|
in ''
|
|
|
|
${concatStrings (catAttrs "shellHook" [ mavenAndNpmDeps androidEnv ])}
|
2019-11-13 13:12:02 +00:00
|
|
|
|
2019-06-04 16:50:29 +00:00
|
|
|
$STATUS_REACT_HOME/scripts/generate-keystore.sh
|
|
|
|
$STATUS_REACT_HOME/nix/mobile/reset-node_modules.sh "${mavenAndNpmDeps.deriv}/project" || exit
|
|
|
|
'';
|
|
|
|
|
|
|
|
# TARGETS
|
|
|
|
inherit release generate-maven-and-npm-deps-shell;
|
|
|
|
adb = {
|
|
|
|
shell = adb-shell;
|
|
|
|
};
|
|
|
|
}
|