Skip to content

Commit

Permalink
xcodeenv: make it work with Xcode 8.2.1
Browse files Browse the repository at this point in the history
(cherry picked from commit 0f6eab5)
  • Loading branch information
Sander van der Burg committed Jan 25, 2017
1 parent 36d024b commit 5839baa
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkgs/development/mobile/titaniumenv/build-app.nix
@@ -1,7 +1,7 @@
{stdenv, androidsdk, titaniumsdk, titanium, alloy, xcodewrapper, jdk, python, nodejs, which, xcodeBaseDir}:
{ name, src, target, androidPlatformVersions ? [ "23" ], androidAbiVersions ? [ "armeabi" "armeabi-v7a" ], tiVersion ? null
, release ? false, androidKeyStore ? null, androidKeyAlias ? null, androidKeyStorePassword ? null
, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "9.2"
, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "10.2"
, enableWirelessDistribution ? false, installURL ? null
}:

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/mobile/titaniumenv/default.nix
@@ -1,4 +1,4 @@
{pkgs, pkgs_i686, xcodeVersion ? "7.2", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "6.0.2.GA"}:
{pkgs, pkgs_i686, xcodeVersion ? "8.2.1", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "6.0.2.GA"}:

rec {
androidenv = pkgs.androidenv;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/mobile/titaniumenv/examples/default.nix
@@ -1,10 +1,10 @@
{ nixpkgs ? <nixpkgs>
, systems ? [ "x86_64-linux" "x86_64-darwin" ]
, xcodeVersion ? "7.2"
, xcodeVersion ? "8.2.1"
, xcodeBaseDir ? "/Applications/Xcode.app"
, tiVersion ? "6.0.2.GA"
, rename ? false
, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "9.2"
, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "10.2"
, enableWirelessDistribution ? false, installURL ? null
}:

Expand Down
Expand Up @@ -3,5 +3,5 @@
xcodeenv.simulateApp {
name = "simulate-${kitchensink.name}";
inherit bundleId;
app = "${kitchensink}/build/iphone/build/Debug-iphonesimulator";
app = "${kitchensink}/build/iphone/build/Products/Debug-iphonesimulator";
}
10 changes: 2 additions & 8 deletions pkgs/development/mobile/xcodeenv/build-app.nix
@@ -1,12 +1,11 @@
{stdenv, xcodewrapper}:
{ name
, src
, sdkVersion ? "6.1"
, sdkVersion ? "10.2"
, target ? null
, configuration ? null
, scheme ? null
, sdk ? null
, arch ? null
, xcodeFlags ? ""
, release ? false
, codeSignIdentity ? null
Expand Down Expand Up @@ -35,11 +34,6 @@ let
if release then "Release" else "Debug"
else configuration;

_arch = if arch == null
then
if release then "armv7" else "x86_64"
else arch;

_sdk = if sdk == null
then
if release then "iphoneos" + sdkVersion else "iphonesimulator" + sdkVersion
Expand Down Expand Up @@ -83,7 +77,7 @@ stdenv.mkDerivation {
''}
# Do the building
xcodebuild -target ${_target} -configuration ${_configuration} ${stdenv.lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} -arch ${_arch} ONLY_ACTIVE_ARCH=NO VALID_ARCHS="${_arch}" CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateXCArchive then "archive" else ""} ${xcodeFlags} ${if release then ''"CODE_SIGN_IDENTITY=${codeSignIdentity}" PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName"'' else ""}
xcodebuild -target ${_target} -configuration ${_configuration} ${stdenv.lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} TARGETED_DEVICE_FAMILY="1, 2" ONLY_ACTIVE_ARCH=NO CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateXCArchive then "archive" else ""} ${xcodeFlags} ${if release then ''"CODE_SIGN_IDENTITY=${codeSignIdentity}" PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName"'' else ""}
${stdenv.lib.optionalString release ''
${stdenv.lib.optionalString generateIPA ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/mobile/xcodeenv/default.nix
@@ -1,4 +1,4 @@
{stdenv, version ? "7.2", xcodeBaseDir ? "/Applications/Xcode.app"}:
{stdenv, version ? "8.2.1", xcodeBaseDir ? "/Applications/Xcode.app"}:

rec {
xcodewrapper = import ./xcodewrapper.nix {
Expand Down
5 changes: 2 additions & 3 deletions pkgs/development/mobile/xcodeenv/simulate-app.nix
Expand Up @@ -25,15 +25,15 @@ stdenv.mkDerivation {
# Copy the app and restore the write permissions
appTmpDir=$(mktemp -d -t appTmpDir)
cp -r "$(echo ${app}/*.app)" $appTmpDir
cp -r "$(echo ${app}/*.app)" "$appTmpDir"
chmod -R 755 "$(echo $appTmpDir/*.app)"
# Wait for the simulator to start
echo "Press enter when the simulator is started..."
read
# Install the app
xcrun simctl install $udid "$(echo $appTmpDir/*.app)"
xcrun simctl install "$udid" "$(echo $appTmpDir/*.app)"
# Remove the app tempdir
rm -Rf $appTmpDir
Expand All @@ -45,4 +45,3 @@ stdenv.mkDerivation {
chmod +x $out/bin/run-test-simulator
'';
}

2 changes: 1 addition & 1 deletion pkgs/development/mobile/xcodeenv/xcodewrapper.nix
Expand Up @@ -8,8 +8,8 @@ stdenv.mkDerivation {
ln -s /usr/bin/xcode-select
ln -s /usr/bin/security
ln -s /usr/bin/codesign
ln -s /usr/bin/xcrun
ln -s "${xcodeBaseDir}/Contents/Developer/usr/bin/xcodebuild"
ln -s "${xcodeBaseDir}/Contents/Developer/usr/bin/xcrun"
ln -s "${xcodeBaseDir}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator"
cd ..
Expand Down

0 comments on commit 5839baa

Please sign in to comment.