2020-04-26 12:40:06 +00:00
|
|
|
{ config, lib, callPackage, mkShell, flock, lsof, openjdk, gradle_5,
|
2020-04-22 17:05:18 +00:00
|
|
|
status-go, localMavenRepoBuilder, projectNodePackage, androidPkgs, androidShell }:
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
let
|
2020-04-15 11:12:56 +00:00
|
|
|
gradle = gradle_5; # Currently 5.6.4
|
2019-09-07 12:57:22 +00:00
|
|
|
clojureDeps = import ../../deps/clojure/deps.nix { };
|
2019-11-29 10:20:08 +00:00
|
|
|
|
|
|
|
# Import a jsbundle compiled out of clojure codebase
|
2020-04-26 12:40:06 +00:00
|
|
|
jsbundle = callPackage ./jsbundle {
|
2019-09-07 12:57:22 +00:00
|
|
|
inherit clojureDeps localMavenRepoBuilder projectNodePackage;
|
2019-11-29 10:20:08 +00:00
|
|
|
};
|
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;
|
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;
|
|
|
|
};
|
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;
|
|
|
|
|
2020-04-26 12:40:06 +00:00
|
|
|
shell = lib.mergeSh
|
2019-11-29 10:20:08 +00:00
|
|
|
(mkShell {
|
|
|
|
inherit buildInputs;
|
|
|
|
inputsFrom = [ release gradle ];
|
|
|
|
shellHook = ''
|
2020-04-22 17:05:18 +00:00
|
|
|
export ANDROID_SDK_ROOT="${androidPkgs}"
|
|
|
|
export ANDROID_NDK_ROOT="${androidPkgs}/ndk-bundle"
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
})
|
2020-04-24 17:41:06 +00:00
|
|
|
[ status-go.shell mavenAndNpmDeps.shell androidShell ];
|
2019-11-29 10:20:08 +00:00
|
|
|
|
2020-03-16 10:57:13 +00:00
|
|
|
env = {
|
2020-04-22 17:05:18 +00:00
|
|
|
shell = androidShell;
|
2019-06-04 16:50:29 +00:00
|
|
|
};
|
|
|
|
}
|