2013-01-07 16:52:42 +01:00
|
|
|
{stdenv, xcodewrapper}:
|
2013-05-29 15:01:55 +02:00
|
|
|
{name, appName ? null, app, device ? "iPhone", baseDir ? ""}:
|
2013-01-07 16:52:42 +01:00
|
|
|
|
2013-05-29 15:01:55 +02:00
|
|
|
let
|
|
|
|
_appName = if appName == null then name else appName;
|
|
|
|
in
|
2013-01-07 16:52:42 +01:00
|
|
|
stdenv.mkDerivation {
|
2013-02-12 11:35:21 +01:00
|
|
|
name = stdenv.lib.replaceChars [" "] [""] name;
|
2013-01-07 16:52:42 +01:00
|
|
|
buildCommand = ''
|
|
|
|
ensureDir $out/bin
|
|
|
|
cat > $out/bin/run-test-simulator << "EOF"
|
|
|
|
#! ${stdenv.shell} -e
|
|
|
|
|
2013-05-29 15:01:55 +02:00
|
|
|
cd "${app}/${baseDir}/${_appName}.app"
|
|
|
|
"$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${_appName}' -SimulateDevice '${device}'
|
2013-01-07 16:52:42 +01:00
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/run-test-simulator
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|