2020-03-02 11:18:01 +00:00
|
|
|
{ config, lib, callPackage, mkShell, mergeSh, androidenv, flock, lsof, openjdk,
|
2019-11-29 10:20:08 +00:00
|
|
|
status-go, localMavenRepoBuilder, projectNodePackage }:
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
gradle = callPackage ./gradle.nix { };
|
2019-11-29 10:20:08 +00:00
|
|
|
androidEnv = callPackage ./android-env.nix { };
|
|
|
|
leinProjectDeps = import ../../lein/lein-project-deps.nix { };
|
|
|
|
|
|
|
|
# Import a jsbundle compiled out of clojure codebase
|
|
|
|
jsbundle = callPackage ./jsbundle/default.nix {
|
|
|
|
inherit leinProjectDeps localMavenRepoBuilder projectNodePackage;
|
|
|
|
};
|
2019-06-04 16:50:29 +00:00
|
|
|
|
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-11-29 10:20:08 +00:00
|
|
|
mavenAndNpmDeps = callPackage ./maven-and-npm-deps {
|
|
|
|
inherit gradle localMavenRepoBuilder projectNodePackage;
|
|
|
|
};
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
# TARGETS
|
2019-11-29 10:20:08 +00:00
|
|
|
release = callPackage ./targets/release-android.nix {
|
|
|
|
inherit config gradle mavenAndNpmDeps jsbundle status-go watchmanFactory;
|
|
|
|
androidEnvShellHook = androidEnv.shell.shellHook;
|
2019-06-04 16:50:29 +00:00
|
|
|
};
|
|
|
|
|
2019-11-29 10:20:08 +00:00
|
|
|
generate-maven-and-npm-deps-shell = callPackage ./maven-and-npm-deps/maven/shell.nix {
|
|
|
|
inherit gradle projectNodePackage status-go;
|
|
|
|
androidEnvShellHook = androidEnv.shell.shellHook;
|
|
|
|
};
|
2019-06-04 16:50:29 +00:00
|
|
|
|
2019-11-29 10:20:08 +00:00
|
|
|
buildInputs = [
|
|
|
|
mavenAndNpmDeps.drv openjdk gradle
|
2020-03-02 11:18:01 +00:00
|
|
|
lsof # used in start-react-native.sh
|
2019-09-13 13:45:24 +00:00
|
|
|
flock # used in reset-node_modules.sh
|
|
|
|
];
|
2019-06-04 16:50:29 +00:00
|
|
|
|
2019-11-29 10:20:08 +00:00
|
|
|
in {
|
2019-06-04 16:50:29 +00:00
|
|
|
# TARGETS
|
2019-11-29 10:20:08 +00:00
|
|
|
inherit release jsbundle generate-maven-and-npm-deps-shell buildInputs;
|
|
|
|
inherit (androidEnv) androidComposition;
|
|
|
|
|
|
|
|
shell = mergeSh
|
|
|
|
(mkShell {
|
|
|
|
inherit buildInputs;
|
|
|
|
inputsFrom = [ release gradle ];
|
|
|
|
shellHook = ''
|
2020-03-02 11:18:01 +00:00
|
|
|
# check if node modules changed and if so install them
|
|
|
|
$STATUS_REACT_HOME/nix/mobile/reset-node_modules.sh \
|
|
|
|
"${mavenAndNpmDeps.drv}/project"
|
2019-11-29 10:20:08 +00:00
|
|
|
'';
|
|
|
|
})
|
|
|
|
(lib.catAttrs "shell" [ status-go mavenAndNpmDeps androidEnv ]);
|
|
|
|
|
2019-06-04 16:50:29 +00:00
|
|
|
adb = {
|
2019-11-29 10:20:08 +00:00
|
|
|
shell = mkShell {
|
|
|
|
buildInputs = [ androidEnv.drv ];
|
|
|
|
inherit (androidEnv.shell) shellHook;
|
|
|
|
};
|
2019-06-04 16:50:29 +00:00
|
|
|
};
|
|
|
|
}
|