2019-06-04 16:50:29 +00:00
|
|
|
{ config, stdenv, stdenvNoCC, target-os, callPackage, mkShell,
|
|
|
|
mkFilter, androidenv, fetchurl, 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 { };
|
|
|
|
|
|
|
|
# Import a local patched version of node_modules, together with a local version of the Maven repo
|
|
|
|
mavenAndNpmDeps = callPackage ./maven-and-npm-deps { inherit stdenv stdenvNoCC gradle bash nodejs zlib localMavenRepoBuilder mkFilter projectNodePackage status-go; androidEnvShellHook = androidEnv.shellHook; };
|
|
|
|
|
|
|
|
# TARGETS
|
2019-07-23 20:54:17 +00:00
|
|
|
release = callPackage ./targets/release-android.nix { inherit target-os gradle mavenAndNpmDeps mkFilter nodejs jsbundle status-go zlib; androidEnvShellHook = androidEnv.shellHook; };
|
2019-06-04 16:50:29 +00:00
|
|
|
generate-maven-and-npm-deps-shell = callPackage ./maven-and-npm-deps/maven/shell.nix { inherit gradle maven projectNodePackage status-go; androidEnvShellHook = androidEnv.shellHook; };
|
|
|
|
adb-shell = mkShell {
|
|
|
|
buildInputs = [ androidEnv.licensedAndroidEnv ];
|
|
|
|
inherit (androidEnv) shellHook;
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
inherit (androidEnv) androidComposition;
|
|
|
|
|
|
|
|
buildInputs = assert platform.targetAndroid; [ mavenAndNpmDeps.deriv openjdk gradle ];
|
|
|
|
shellHook =
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) catAttrs concatStrings;
|
|
|
|
in ''
|
|
|
|
${concatStrings (catAttrs "shellHook" [ mavenAndNpmDeps androidEnv ])}
|
|
|
|
|
|
|
|
$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;
|
|
|
|
};
|
|
|
|
}
|