summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/cordova
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/cordova')
-rwxr-xr-xStoneIsland/platforms/ios/cordova/build.xcconfig2
-rwxr-xr-xStoneIsland/platforms/ios/cordova/lib/build.js14
-rwxr-xr-xStoneIsland/platforms/ios/cordova/lib/prepare.js120
-rwxr-xr-xStoneIsland/platforms/ios/cordova/node_modules/nopt/package.json44
-rwxr-xr-xStoneIsland/platforms/ios/cordova/node_modules/q/package.json45
-rwxr-xr-xStoneIsland/platforms/ios/cordova/node_modules/shelljs/package.json45
-rwxr-xr-xStoneIsland/platforms/ios/cordova/version2
7 files changed, 235 insertions, 37 deletions
diff --git a/StoneIsland/platforms/ios/cordova/build.xcconfig b/StoneIsland/platforms/ios/cordova/build.xcconfig
index bc9e0e3f..cc78c73e 100755
--- a/StoneIsland/platforms/ios/cordova/build.xcconfig
+++ b/StoneIsland/platforms/ios/cordova/build.xcconfig
@@ -23,9 +23,7 @@
//
HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
-IPHONEOS_DEPLOYMENT_TARGET = 8.0
OTHER_LDFLAGS = -ObjC
-TARGETED_DEVICE_FAMILY = 1,2
// Type of signing identity used for codesigning, resolves to first match of given type.
// "iPhone Developer": Development builds (default, local only; iOS Development certificate) or "iPhone Distribution": Distribution builds (Adhoc/In-House/AppStore; iOS Distribution certificate)
diff --git a/StoneIsland/platforms/ios/cordova/lib/build.js b/StoneIsland/platforms/ios/cordova/lib/build.js
index a26f1983..c40bfe8b 100755
--- a/StoneIsland/platforms/ios/cordova/lib/build.js
+++ b/StoneIsland/platforms/ios/cordova/lib/build.js
@@ -76,7 +76,7 @@ module.exports.run = function (buildOpts) {
var buildType = buildOpts.release ? 'release' : 'debug';
var config = buildConfig.ios[buildType];
if(config) {
- ['codeSignIdentity', 'codeSignResourceRules', 'provisioningProfile', 'developmentTeam', 'packageType'].forEach(
+ ['codeSignIdentity', 'codeSignResourceRules', 'provisioningProfile', 'developmentTeam', 'packageType', 'buildFlag'].forEach(
function(key) {
buildOpts[key] = buildOpts[key] || config[key];
});
@@ -84,7 +84,17 @@ module.exports.run = function (buildOpts) {
}
}
- return check_reqs.run().then(function () {
+return require('./list-devices').run()
+ .then(function (devices) {
+ if (devices.length > 0 && !(buildOpts.emulator)) {
+ // we also explicitly set device flag in options as we pass
+ // those parameters to other api (build as an example)
+ buildOpts.device = true;
+ return check_reqs.check_ios_deploy();
+ }
+ }).then(function () {
+ return check_reqs.run();
+ }).then(function () {
return findXCodeProjectIn(projectPath);
}).then(function (name) {
projectName = name;
diff --git a/StoneIsland/platforms/ios/cordova/lib/prepare.js b/StoneIsland/platforms/ios/cordova/lib/prepare.js
index 8d1cda94..d8f52ac9 100755
--- a/StoneIsland/platforms/ios/cordova/lib/prepare.js
+++ b/StoneIsland/platforms/ios/cordova/lib/prepare.js
@@ -34,6 +34,14 @@ var PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger;
var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
var FileUpdater = require('cordova-common').FileUpdater;
+// launch storyboard and related constants
+var LAUNCHIMAGE_BUILD_SETTING = 'ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME';
+var LAUNCHIMAGE_BUILD_SETTING_VALUE = 'LaunchImage';
+var UI_LAUNCH_STORYBOARD_NAME = 'UILaunchStoryboardName';
+var CDV_LAUNCH_STORYBOARD_NAME = 'CDVLaunchScreen';
+var IMAGESET_COMPACT_SIZE_CLASS = 'compact';
+var CDV_ANY_SIZE_CLASS = 'any';
+
/*jshint sub:true*/
module.exports.prepare = function (cordovaProject, options) {
@@ -214,7 +222,7 @@ function updateProject(platformConfig, locations) {
fs.writeFileSync(plistFile, info_contents, 'utf-8');
events.emit('verbose', 'Wrote out iOS Bundle Identifier "' + pkg + '" and iOS Bundle Version "' + version + '" to ' + plistFile);
- return handleBuildSettings(platformConfig, locations).then(function() {
+ return handleBuildSettings(platformConfig, locations, infoPlist).then(function() {
if (name == originalName) {
events.emit('verbose', 'iOS Product Name has not changed (still "' + originalName + '")');
return Q();
@@ -258,12 +266,14 @@ function handleOrientationSettings(platformConfig, infoPlist) {
}
}
-function handleBuildSettings(platformConfig, locations) {
+function handleBuildSettings(platformConfig, locations, infoPlist) {
var targetDevice = parseTargetDevicePreference(platformConfig.getPreference('target-device', 'ios'));
var deploymentTarget = platformConfig.getPreference('deployment-target', 'ios');
+ var needUpdatedBuildSettingsForLaunchStoryboard = checkIfBuildSettingsNeedUpdatedForLaunchStoryboard(platformConfig, infoPlist);
- // no build settings provided, we don't need to parse and update .pbxproj file
- if (!targetDevice && !deploymentTarget) {
+ // no build settings provided and we don't need to update build settings for launch storyboards,
+ // then we don't need to parse and update .pbxproj file
+ if (!targetDevice && !deploymentTarget && !needUpdatedBuildSettingsForLaunchStoryboard) {
return Q();
}
@@ -285,6 +295,8 @@ function handleBuildSettings(platformConfig, locations) {
proj.updateBuildProperty('IPHONEOS_DEPLOYMENT_TARGET', deploymentTarget);
}
+ updateBuildSettingsForLaunchStoryboard(proj, platformConfig, infoPlist);
+
fs.writeFileSync(locations.pbxproj, proj.writeSync(), 'utf-8');
return Q();
@@ -572,8 +584,6 @@ function mapLaunchStoryboardResources(splashScreens, launchStoryboardImagesDir)
* @return {Object}
*/
function getLaunchStoryboardContentsJSON(splashScreens, launchStoryboardImagesDir) {
- var IMAGESET_COMPACT_SIZE_CLASS = 'compact';
- var CDV_ANY_SIZE_CLASS = 'any';
var platformLaunchStoryboardImages = mapLaunchStoryboardContents(splashScreens, launchStoryboardImagesDir);
var contentsJSON = {
@@ -608,39 +618,91 @@ function getLaunchStoryboardContentsJSON(splashScreens, launchStoryboardImagesDi
}
/**
- * Updates the project's plist based upon our launch storyboard images. If there are no images, then we should
- * fall back to the regular launch images that might be supplied (that is, our app will be scaled on an iPad Pro),
- * and if there are some images, we need to alter the UILaunchStoryboardName property to point to
- * CDVLaunchScreen.
+ * Determines if the project's build settings may need to be updated for launch storyboard support
*
- * There's some logic here to avoid overwriting changes the user might have made to their plist if they are using
- * their own launch storyboard.
*/
-function updateProjectPlistForLaunchStoryboard(platformConfig, infoPlist) {
- var UI_LAUNCH_STORYBOARD_NAME = 'UILaunchStoryboardName';
- var CDV_LAUNCH_STORYBOARD_NAME = 'CDVLaunchScreen';
-
- var splashScreens = platformConfig.getSplashScreens('ios');
- var contentsJSON = getLaunchStoryboardContentsJSON(splashScreens, ''); // note: we don't need a file path here; we're just counting
+function checkIfBuildSettingsNeedUpdatedForLaunchStoryboard(platformConfig, infoPlist) {
+ var hasLaunchStoryboardImages = platformHasLaunchStoryboardImages(platformConfig);
+ var hasLegacyLaunchImages = platformHasLegacyLaunchImages(platformConfig);
var currentLaunchStoryboard = infoPlist[UI_LAUNCH_STORYBOARD_NAME];
- events.emit('verbose', 'Current launch storyboard ' + currentLaunchStoryboard);
+ if (hasLaunchStoryboardImages && currentLaunchStoryboard == CDV_LAUNCH_STORYBOARD_NAME && !hasLegacyLaunchImages) {
+ // don't need legacy launch images if we are using our launch storyboard
+ // so we do need to update the project file
+ events.emit('verbose', 'Need to update build settings because project is using our launch storyboard.');
+ return true;
+ } else if (hasLegacyLaunchImages && !currentLaunchStoryboard) {
+ // we do need to ensure legacy launch images are used if there's no launch storyboard present
+ // so we do need to update the project file
+ events.emit('verbose', 'Need to update build settings because project is using legacy launch images and no storyboard.');
+ return true;
+ }
+ events.emit('verbose', 'No need to update build settings for launch storyboard support.');
+ return false;
+}
+function updateBuildSettingsForLaunchStoryboard(proj, platformConfig, infoPlist) {
+ var hasLaunchStoryboardImages = platformHasLaunchStoryboardImages(platformConfig);
+ var hasLegacyLaunchImages = platformHasLegacyLaunchImages(platformConfig);
+ var currentLaunchStoryboard = infoPlist[UI_LAUNCH_STORYBOARD_NAME];
+ if (hasLaunchStoryboardImages && currentLaunchStoryboard == CDV_LAUNCH_STORYBOARD_NAME && !hasLegacyLaunchImages) {
+ // don't need legacy launch images if we are using our launch storyboard
+ events.emit('verbose', 'Removed ' + LAUNCHIMAGE_BUILD_SETTING + ' because project is using our launch storyboard.');
+ proj.removeBuildProperty(LAUNCHIMAGE_BUILD_SETTING);
+ } else if (hasLegacyLaunchImages && !currentLaunchStoryboard) {
+ // we do need to ensure legacy launch images are used if there's no launch storyboard present
+ events.emit('verbose', 'Set ' + LAUNCHIMAGE_BUILD_SETTING + ' to ' + LAUNCHIMAGE_BUILD_SETTING_VALUE + ' because project is using legacy launch images and no storyboard.');
+ proj.updateBuildProperty(LAUNCHIMAGE_BUILD_SETTING, LAUNCHIMAGE_BUILD_SETTING_VALUE);
+ } else {
+ events.emit('verbose', 'Did not update build settings for launch storyboard support.');
+ }
+}
+
+function splashScreensHaveLaunchStoryboardImages(contentsJSON) {
/* do we have any launch images do we have for our launch storyboard?
* Again, for old Node versions, the below code is equivalent to this:
- * var hasLaunchStoryboardImages = !!contentsJSON.images.find(function (item) {
+ * return !!contentsJSON.images.find(function (item) {
* return item.filename !== undefined;
* });
*/
- var hasLaunchStoryboardImages = !!contentsJSON.images.reduce(function (p, c) {
+ return !!contentsJSON.images.reduce(function (p, c) {
return (c.filename !== undefined) ? c : p;
}, undefined);
+}
+
+function platformHasLaunchStoryboardImages(platformConfig) {
+ var splashScreens = platformConfig.getSplashScreens('ios');
+ var contentsJSON = getLaunchStoryboardContentsJSON(splashScreens, ''); // note: we don't need a file path here; we're just counting
+ return splashScreensHaveLaunchStoryboardImages(contentsJSON);
+}
+
+function platformHasLegacyLaunchImages(platformConfig) {
+ var splashScreens = platformConfig.getSplashScreens('ios');
+ return !!splashScreens.reduce(function (p, c) {
+ return (c.width !== undefined || c.height !== undefined) ? c : p;
+ }, undefined);
+}
+
+/**
+ * Updates the project's plist based upon our launch storyboard images. If there are no images, then we should
+ * fall back to the regular launch images that might be supplied (that is, our app will be scaled on an iPad Pro),
+ * and if there are some images, we need to alter the UILaunchStoryboardName property to point to
+ * CDVLaunchScreen.
+ *
+ * There's some logic here to avoid overwriting changes the user might have made to their plist if they are using
+ * their own launch storyboard.
+ */
+function updateProjectPlistForLaunchStoryboard(platformConfig, infoPlist) {
+ var currentLaunchStoryboard = infoPlist[UI_LAUNCH_STORYBOARD_NAME];
+ events.emit('verbose', 'Current launch storyboard ' + currentLaunchStoryboard);
+
+ var hasLaunchStoryboardImages = platformHasLaunchStoryboardImages(platformConfig);
if (hasLaunchStoryboardImages && !currentLaunchStoryboard) {
// only change the launch storyboard if we have images to use AND the current value is blank
// if it's not blank, we've either done this before, or the user has their own launch storyboard
- events.emit('verbose', 'Changing project to use our launch storyboard');
+ events.emit('verbose', 'Changing info plist to use our launch storyboard');
infoPlist[UI_LAUNCH_STORYBOARD_NAME] = CDV_LAUNCH_STORYBOARD_NAME;
return;
}
@@ -649,11 +711,11 @@ function updateProjectPlistForLaunchStoryboard(platformConfig, infoPlist) {
// only revert to using the launch images if we have don't have any images for the launch storyboard
// but only clear it if current launch storyboard is our storyboard; the user might be using their
// own storyboard instead.
- events.emit('verbose', 'Changing project to use launch images');
- infoPlist[UI_LAUNCH_STORYBOARD_NAME] = undefined;
+ events.emit('verbose', 'Changing info plist to use legacy launch images');
+ delete infoPlist[UI_LAUNCH_STORYBOARD_NAME];
return;
}
- events.emit('verbose', 'Not changing launch storyboard setting.');
+ events.emit('verbose', 'Not changing launch storyboard setting in info plist.');
}
/**
@@ -685,7 +747,7 @@ function getLaunchStoryboardImagesDir(projectRoot, platformProjDir) {
*/
function updateLaunchStoryboardImages(cordovaProject, locations) {
var splashScreens = cordovaProject.projectConfig.getSplashScreens('ios');
- var platformProjDir = locations.xcodeCordovaProj;
+ var platformProjDir = path.relative(cordovaProject.root, locations.xcodeCordovaProj);
var launchStoryboardImagesDir = getLaunchStoryboardImagesDir(cordovaProject.root, platformProjDir);
if (launchStoryboardImagesDir) {
@@ -697,7 +759,7 @@ function updateLaunchStoryboardImages(cordovaProject, locations) {
resourceMap, { rootDir: cordovaProject.root }, logFileOp);
events.emit('verbose', 'Updating Storyboard image set contents.json');
- fs.writeFileSync(path.join(launchStoryboardImagesDir, 'contents.json'),
+ fs.writeFileSync(path.join(cordovaProject.root, launchStoryboardImagesDir, 'Contents.json'),
JSON.stringify(contentsJSON, null, 2));
}
}
@@ -712,7 +774,7 @@ function updateLaunchStoryboardImages(cordovaProject, locations) {
*/
function cleanLaunchStoryboardImages(projectRoot, projectConfig, locations) {
var splashScreens = projectConfig.getSplashScreens('ios');
- var platformProjDir = locations.xcodeCordovaProj;
+ var platformProjDir = path.relative(projectRoot, locations.xcodeCordovaProj);
var launchStoryboardImagesDir = getLaunchStoryboardImagesDir(projectRoot, platformProjDir);
if (launchStoryboardImagesDir) {
var resourceMap = mapLaunchStoryboardResources(splashScreens, launchStoryboardImagesDir);
@@ -733,7 +795,7 @@ function cleanLaunchStoryboardImages(projectRoot, projectConfig, locations) {
});
events.emit('verbose', 'Updating Storyboard image set contents.json');
- fs.writeFileSync(path.join(launchStoryboardImagesDir, 'contents.json'),
+ fs.writeFileSync(path.join(projectRoot, launchStoryboardImagesDir, 'Contents.json'),
JSON.stringify(contentsJSON, null, 2));
}
}
diff --git a/StoneIsland/platforms/ios/cordova/node_modules/nopt/package.json b/StoneIsland/platforms/ios/cordova/node_modules/nopt/package.json
index c0025bda..727d271a 100755
--- a/StoneIsland/platforms/ios/cordova/node_modules/nopt/package.json
+++ b/StoneIsland/platforms/ios/cordova/node_modules/nopt/package.json
@@ -1,4 +1,46 @@
{
+ "_args": [
+ [
+ {
+ "raw": "nopt@^3.0.6",
+ "scope": null,
+ "escapedName": "nopt",
+ "name": "nopt",
+ "rawSpec": "^3.0.6",
+ "spec": ">=3.0.6 <4.0.0",
+ "type": "range"
+ },
+ "/Users/shazron/Documents/git/apache/cordova-ios"
+ ]
+ ],
+ "_from": "nopt@>=3.0.6 <4.0.0",
+ "_id": "nopt@3.0.6",
+ "_inCache": true,
+ "_location": "/nopt",
+ "_nodeVersion": "4.2.1",
+ "_npmUser": {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ },
+ "_npmVersion": "2.14.10",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "nopt@^3.0.6",
+ "scope": null,
+ "escapedName": "nopt",
+ "name": "nopt",
+ "rawSpec": "^3.0.6",
+ "spec": ">=3.0.6 <4.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
+ "_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9",
+ "_shrinkwrap": null,
+ "_spec": "nopt@^3.0.6",
+ "_where": "/Users/shazron/Documents/git/apache/cordova-ios",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -51,4 +93,4 @@
"test": "tap test/*.js"
},
"version": "3.0.6"
-} \ No newline at end of file
+}
diff --git a/StoneIsland/platforms/ios/cordova/node_modules/q/package.json b/StoneIsland/platforms/ios/cordova/node_modules/q/package.json
index 5ad2a032..f17a9377 100755
--- a/StoneIsland/platforms/ios/cordova/node_modules/q/package.json
+++ b/StoneIsland/platforms/ios/cordova/node_modules/q/package.json
@@ -1,4 +1,47 @@
{
+ "_args": [
+ [
+ {
+ "raw": "q@^1.4.1",
+ "scope": null,
+ "escapedName": "q",
+ "name": "q",
+ "rawSpec": "^1.4.1",
+ "spec": ">=1.4.1 <2.0.0",
+ "type": "range"
+ },
+ "/Users/shazron/Documents/git/apache/cordova-ios"
+ ]
+ ],
+ "_from": "q@>=1.4.1 <2.0.0",
+ "_id": "q@1.4.1",
+ "_inCache": true,
+ "_location": "/q",
+ "_nodeVersion": "1.8.1",
+ "_npmUser": {
+ "name": "kriskowal",
+ "email": "kris.kowal@cixar.com"
+ },
+ "_npmVersion": "2.8.3",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "q@^1.4.1",
+ "scope": null,
+ "escapedName": "q",
+ "name": "q",
+ "rawSpec": "^1.4.1",
+ "spec": ">=1.4.1 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/",
+ "/cordova-common"
+ ],
+ "_resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz",
+ "_shasum": "55705bcd93c5f3673530c2c2cbc0c2b3addc286e",
+ "_shrinkwrap": null,
+ "_spec": "q@^1.4.1",
+ "_where": "/Users/shazron/Documents/git/apache/cordova-ios",
"author": {
"name": "Kris Kowal",
"email": "kris@cixar.com",
@@ -108,4 +151,4 @@
"test-browser": "opener spec/q-spec.html"
},
"version": "1.4.1"
-} \ No newline at end of file
+}
diff --git a/StoneIsland/platforms/ios/cordova/node_modules/shelljs/package.json b/StoneIsland/platforms/ios/cordova/node_modules/shelljs/package.json
index 9827ccbc..fd830f8e 100755
--- a/StoneIsland/platforms/ios/cordova/node_modules/shelljs/package.json
+++ b/StoneIsland/platforms/ios/cordova/node_modules/shelljs/package.json
@@ -1,4 +1,47 @@
{
+ "_args": [
+ [
+ {
+ "raw": "shelljs@^0.5.3",
+ "scope": null,
+ "escapedName": "shelljs",
+ "name": "shelljs",
+ "rawSpec": "^0.5.3",
+ "spec": ">=0.5.3 <0.6.0",
+ "type": "range"
+ },
+ "/Users/shazron/Documents/git/apache/cordova-ios"
+ ]
+ ],
+ "_from": "shelljs@>=0.5.3 <0.6.0",
+ "_id": "shelljs@0.5.3",
+ "_inCache": true,
+ "_location": "/shelljs",
+ "_nodeVersion": "1.2.0",
+ "_npmUser": {
+ "name": "artur",
+ "email": "arturadib@gmail.com"
+ },
+ "_npmVersion": "2.5.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "shelljs@^0.5.3",
+ "scope": null,
+ "escapedName": "shelljs",
+ "name": "shelljs",
+ "rawSpec": "^0.5.3",
+ "spec": ">=0.5.3 <0.6.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/",
+ "/cordova-common"
+ ],
+ "_resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz",
+ "_shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113",
+ "_shrinkwrap": null,
+ "_spec": "shelljs@^0.5.3",
+ "_where": "/Users/shazron/Documents/git/apache/cordova-ios",
"author": {
"name": "Artur Adib",
"email": "arturadib@gmail.com"
@@ -51,4 +94,4 @@
"test": "node scripts/run-tests"
},
"version": "0.5.3"
-} \ No newline at end of file
+}
diff --git a/StoneIsland/platforms/ios/cordova/version b/StoneIsland/platforms/ios/cordova/version
index 99ce9729..9f3eb479 100755
--- a/StoneIsland/platforms/ios/cordova/version
+++ b/StoneIsland/platforms/ios/cordova/version
@@ -26,7 +26,7 @@
*/
// Coho updates this line
-var VERSION="4.3.0";
+var VERSION="4.3.1";
module.exports.version = VERSION;