Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Commit

Permalink
Min required version of iOS is set to 8 instead of 9. And we will ove…
Browse files Browse the repository at this point in the history
…rwrite it only, if deployment target is less then 8. Fix for #20
  • Loading branch information
nikDemyankov committed Dec 8, 2015
1 parent d91bc85 commit 818edb7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
19 changes: 15 additions & 4 deletions hooks/lib/ios/xcodePreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ Which is:
(function() {

var path = require('path'),
compare = require('node-version-compare'),
ConfigXmlHelper = require('../configXmlHelper.js'),
// pbxFile = require('xcode/lib/pbxFile'),
IOS_DEPLOYMENT_TARGET = '9.0',
IOS_DEPLOYMENT_TARGET = '8.0',
COMMENT_KEY = /_comment$/,
context;

Expand Down Expand Up @@ -56,14 +57,24 @@ Which is:
var configurations = nonComments(xcodeProject.pbxXCBuildConfigurationSection()),
entitlementsFilePath = pathToEntitlementsFile(),
config,
buildSettings;
buildSettings,
deploymentTargetIsUpdated;

for (config in configurations) {
buildSettings = configurations[config].buildSettings;
buildSettings['IPHONEOS_DEPLOYMENT_TARGET'] = IOS_DEPLOYMENT_TARGET;
buildSettings['CODE_SIGN_ENTITLEMENTS'] = '"' + entitlementsFilePath + '"';

// if deployment target is less then the required one - increase it
if (compare(buildSettings['IPHONEOS_DEPLOYMENT_TARGET'], IOS_DEPLOYMENT_TARGET) == -1) {
buildSettings['IPHONEOS_DEPLOYMENT_TARGET'] = IOS_DEPLOYMENT_TARGET;
deploymentTargetIsUpdated = true;
}
}
console.log('IOS project now has deployment target set as: ' + IOS_DEPLOYMENT_TARGET);

if (deploymentTargetIsUpdated) {
console.log('IOS project now has deployment target set as: ' + IOS_DEPLOYMENT_TARGET);
}

console.log('IOS project Code Sign Entitlements now set to: ' + entitlementsFilePath);
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"dependencies": {
"mkpath": ">=0.1",
"xml2js": ">=0.4",
"rimraf": ">=2.4"
"rimraf": ">=2.4",
"node-version-compare": ">=1.0.1"
},
"author": "Nikolay Demyankov for Nordnet Bank AB",
"license": "MIT",
Expand Down

0 comments on commit 818edb7

Please sign in to comment.