2019-06-04 16:50:29 +00:00
|
|
|
{ stdenv, target-os, callPackage, mkShell, makeWrapper,
|
|
|
|
bundlerEnv, bundler, ruby, curl }:
|
|
|
|
|
|
|
|
let
|
2019-07-15 10:17:21 +00:00
|
|
|
inherit (stdenv.lib) optionals optionalString unique;
|
|
|
|
|
2019-06-04 16:50:29 +00:00
|
|
|
platform = callPackage ../../platform.nix { inherit target-os; };
|
|
|
|
useFastlanePkg = platform.targetAndroid && !stdenv.isDarwin;
|
|
|
|
fastlane = callPackage ../../../fastlane {
|
2019-07-29 08:33:35 +00:00
|
|
|
bundlerEnv = _:
|
|
|
|
bundlerEnv {
|
|
|
|
name = "fastlane-gems";
|
|
|
|
gemdir = ../../../fastlane;
|
|
|
|
};
|
2019-06-04 16:50:29 +00:00
|
|
|
};
|
2019-07-29 08:33:35 +00:00
|
|
|
bundlerDeps = optionals platform.targetMobile [
|
|
|
|
bundler
|
|
|
|
ruby
|
|
|
|
]; # bundler/ruby used for fastlane on macOS
|
2019-07-15 10:17:21 +00:00
|
|
|
shellHook = optionalString useFastlanePkg fastlane.shellHook;
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
# TARGETS
|
|
|
|
shell = mkShell {
|
2019-07-29 08:33:35 +00:00
|
|
|
buildInputs = if useFastlanePkg then [ fastlane curl ] else bundlerDeps;
|
2019-07-15 10:17:21 +00:00
|
|
|
inherit shellHook;
|
2019-06-04 16:50:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
2019-07-15 10:17:21 +00:00
|
|
|
# We only include bundler in regular shell if targetting iOS, because that's how the CI builds the whole project
|
|
|
|
buildInputs = unique (optionals (!useFastlanePkg && platform.targetIOS) bundlerDeps);
|
|
|
|
inherit shellHook;
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
# TARGETS
|
|
|
|
inherit shell;
|
|
|
|
}
|