It's impossible to guess the name so we add an extra optional parameter to override it

This commit is contained in:
Sander van der Burg 2013-05-29 15:01:55 +02:00
parent a7895de1fc
commit a2b8fb3776

View File

@ -1,6 +1,9 @@
{stdenv, xcodewrapper}: {stdenv, xcodewrapper}:
{name, app, device ? "iPhone", baseDir ? ""}: {name, appName ? null, app, device ? "iPhone", baseDir ? ""}:
let
_appName = if appName == null then name else appName;
in
stdenv.mkDerivation { stdenv.mkDerivation {
name = stdenv.lib.replaceChars [" "] [""] name; name = stdenv.lib.replaceChars [" "] [""] name;
buildCommand = '' buildCommand = ''
@ -8,8 +11,8 @@ stdenv.mkDerivation {
cat > $out/bin/run-test-simulator << "EOF" cat > $out/bin/run-test-simulator << "EOF"
#! ${stdenv.shell} -e #! ${stdenv.shell} -e
cd "${app}/${baseDir}/*.app" cd "${app}/${baseDir}/${_appName}.app"
"$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${name}' -SimulateDevice '${device}' "$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${_appName}' -SimulateDevice '${device}'
EOF EOF
chmod +x $out/bin/run-test-simulator chmod +x $out/bin/run-test-simulator
''; '';