2013-01-07 16:52:42 +01:00
|
|
|
{stdenv, xcodewrapper}:
|
|
|
|
{name, app, device ? "iPhone", baseDir ? ""}:
|
|
|
|
|
|
|
|
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 14:50:24 +02:00
|
|
|
cd "${app}/${baseDir}/*.app"
|
2013-02-12 11:35:21 +01:00
|
|
|
"$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${name}' -SimulateDevice '${device}'
|
2013-01-07 16:52:42 +01:00
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/run-test-simulator
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|