Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Platform Release Preparation (Cordova 9) #496

Merged
merged 10 commits into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions bin/templates/scripts/cordova/lib/BridgingHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function BridgingHeader (bridgingHeaderPath) {
}

BridgingHeader.prototype.addHeader = function (plugin_id, header_path) {
this.bridgingHeaders.push({type: 'code', code: '#import "' + header_path + '"\n'});
this.bridgingHeaders.push({ type: 'code', code: '#import "' + header_path + '"\n' });
};

BridgingHeader.prototype.removeHeader = function (plugin_id, header_path) {
Expand All @@ -47,7 +47,7 @@ BridgingHeader.prototype.removeHeader = function (plugin_id, header_path) {
}
}
return true;
}, {found: false});
}, { found: false });
};

BridgingHeader.prototype.write = function () {
Expand All @@ -71,7 +71,7 @@ BridgingHeader.prototype.__parseForBridgingHeader = function (text) {
case 'comment':
if (i + 1 < text.length && text[i] === '*' && text[i + 1] === '/') {
i += 2;
list.push({type: type, code: text.slice(start, i)});
list.push({ type: type, code: text.slice(start, i) });
type = 'code';
start = i;
} else {
Expand All @@ -81,7 +81,7 @@ BridgingHeader.prototype.__parseForBridgingHeader = function (text) {
case 'line-comment':
if (i < text.length && text[i] === '\n') {
i += 1;
list.push({type: type, code: text.slice(start, i)});
list.push({ type: type, code: text.slice(start, i) });
type = 'code';
start = i;
} else {
Expand All @@ -92,19 +92,19 @@ BridgingHeader.prototype.__parseForBridgingHeader = function (text) {
default:
if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '*') { // comment
if (start < i) {
list.push({type: type, code: text.slice(start, i)});
list.push({ type: type, code: text.slice(start, i) });
}
type = 'comment';
start = i;
} else if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '/') { // line comment
if (start < i) {
list.push({type: type, code: text.slice(start, i)});
list.push({ type: type, code: text.slice(start, i) });
}
type = 'line-comment';
start = i;
} else if (i < text.length && text[i] === '\n') {
i += 1;
list.push({type: type, code: text.slice(start, i)});
list.push({ type: type, code: text.slice(start, i) });
start = i;
} else {
i += 1;
Expand All @@ -113,7 +113,7 @@ BridgingHeader.prototype.__parseForBridgingHeader = function (text) {
}
}
if (start < i) {
list.push({type: type, code: text.slice(start, i)});
list.push({ type: type, code: text.slice(start, i) });
}
return list;
};
Expand Down
6 changes: 3 additions & 3 deletions bin/templates/scripts/cordova/lib/Podfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Podfile.prototype.__parseForDeclarations = function (text) {
// do nothing;
}
return acc;
}, {state: 0, lines: []})
}, { state: 0, lines: [] })
.lines
.filter(function (line) {
return declarationRE.exec(line);
Expand Down Expand Up @@ -197,9 +197,9 @@ Podfile.prototype.addSpec = function (name, spec) {

if (typeof spec === 'string') {
if (spec.startsWith(':')) {
spec = {name: name, options: spec};
spec = { name: name, options: spec };
} else {
spec = {name: name, spec: spec};
spec = { name: name, spec: spec };
}
}

Expand Down
2 changes: 1 addition & 1 deletion bin/templates/scripts/cordova/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ module.exports.run = function (buildOpts) {

var project = createProjectObject(projectPath, projectName);
var bundleIdentifier = getBundleIdentifier(project);
var exportOptions = {'compileBitcode': false, 'method': 'development'};
var exportOptions = { 'compileBitcode': false, 'method': 'development' };

if (buildOpts.packageType) {
exportOptions.method = buildOpts.packageType;
Expand Down
8 changes: 4 additions & 4 deletions bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ var handlers = {
}

var targetDir = fixPathSep(path.resolve(project.plugins_dir, plugin.id, path.basename(src)));
var pbxFile = project.xcode.removeFramework(targetDir, {customFramework: true});
var pbxFile = project.xcode.removeFramework(targetDir, { customFramework: true });
if (pbxFile) {
project.xcode.removeFromPbxEmbedFrameworksBuildPhase(pbxFile);
}
Expand Down Expand Up @@ -268,9 +268,9 @@ function installHelper (type, obj, plugin_dir, project_dir, plugin_id, options,
var opt = { weak: obj.weak };
var project_relative = path.join(path.basename(project.xcode_path), project_ref);
project.xcode.addFramework(project_relative, opt);
project.xcode.addToLibrarySearchPaths({path: project_ref});
project.xcode.addToLibrarySearchPaths({ path: project_ref });
} else {
project.xcode.addSourceFile(project_ref, obj.compilerFlags ? {compilerFlags: obj.compilerFlags} : {});
project.xcode.addSourceFile(project_ref, obj.compilerFlags ? { compilerFlags: obj.compilerFlags } : {});
}
}

Expand All @@ -294,7 +294,7 @@ function uninstallHelper (type, obj, project_dir, plugin_id, options, project) {
} else if (obj.framework) {
var project_relative = path.join(path.basename(project.xcode_path), project_ref);
project.xcode.removeFramework(project_relative);
project.xcode.removeFromLibrarySearchPaths({path: project_ref});
project.xcode.removeFromLibrarySearchPaths({ path: project_ref });
} else {
project.xcode.removeSourceFile(project_ref);
}
Expand Down
87 changes: 44 additions & 43 deletions bin/templates/scripts/cordova/lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,34 +329,34 @@ function mapIconResources (icons, iconsDir) {
// See https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
// for launch images sizes reference.
var platformIcons = [
{dest: 'icon-20.png', width: 20, height: 20},
{dest: 'icon-20@2x.png', width: 40, height: 40},
{dest: 'icon-20@3x.png', width: 60, height: 60},
{dest: 'icon-40.png', width: 40, height: 40},
{dest: 'icon-40@2x.png', width: 80, height: 80},
{dest: 'icon-50.png', width: 50, height: 50},
{dest: 'icon-50@2x.png', width: 100, height: 100},
{dest: 'icon-60@2x.png', width: 120, height: 120},
{dest: 'icon-60@3x.png', width: 180, height: 180},
{dest: 'icon-72.png', width: 72, height: 72},
{dest: 'icon-72@2x.png', width: 144, height: 144},
{dest: 'icon-76.png', width: 76, height: 76},
{dest: 'icon-76@2x.png', width: 152, height: 152},
{dest: 'icon-83.5@2x.png', width: 167, height: 167},
{dest: 'icon-1024.png', width: 1024, height: 1024},
{dest: 'icon-small.png', width: 29, height: 29},
{dest: 'icon-small@2x.png', width: 58, height: 58},
{dest: 'icon-small@3x.png', width: 87, height: 87},
{dest: 'icon.png', width: 57, height: 57},
{dest: 'icon@2x.png', width: 114, height: 114},
{dest: 'AppIcon24x24@2x.png', width: 48, height: 48},
{dest: 'AppIcon27.5x27.5@2x.png', width: 55, height: 55},
{dest: 'AppIcon29x29@2x.png', width: 58, height: 58},
{dest: 'AppIcon29x29@3x.png', width: 87, height: 87},
{dest: 'AppIcon40x40@2x.png', width: 80, height: 80},
{dest: 'AppIcon44x44@2x.png', width: 88, height: 88},
{dest: 'AppIcon86x86@2x.png', width: 172, height: 172},
{dest: 'AppIcon98x98@2x.png', width: 196, height: 196}
{ dest: 'icon-20.png', width: 20, height: 20 },
{ dest: 'icon-20@2x.png', width: 40, height: 40 },
{ dest: 'icon-20@3x.png', width: 60, height: 60 },
{ dest: 'icon-40.png', width: 40, height: 40 },
{ dest: 'icon-40@2x.png', width: 80, height: 80 },
{ dest: 'icon-50.png', width: 50, height: 50 },
{ dest: 'icon-50@2x.png', width: 100, height: 100 },
{ dest: 'icon-60@2x.png', width: 120, height: 120 },
{ dest: 'icon-60@3x.png', width: 180, height: 180 },
{ dest: 'icon-72.png', width: 72, height: 72 },
{ dest: 'icon-72@2x.png', width: 144, height: 144 },
{ dest: 'icon-76.png', width: 76, height: 76 },
{ dest: 'icon-76@2x.png', width: 152, height: 152 },
{ dest: 'icon-83.5@2x.png', width: 167, height: 167 },
{ dest: 'icon-1024.png', width: 1024, height: 1024 },
{ dest: 'icon-small.png', width: 29, height: 29 },
{ dest: 'icon-small@2x.png', width: 58, height: 58 },
{ dest: 'icon-small@3x.png', width: 87, height: 87 },
{ dest: 'icon.png', width: 57, height: 57 },
{ dest: 'icon@2x.png', width: 114, height: 114 },
{ dest: 'AppIcon24x24@2x.png', width: 48, height: 48 },
{ dest: 'AppIcon27.5x27.5@2x.png', width: 55, height: 55 },
{ dest: 'AppIcon29x29@2x.png', width: 58, height: 58 },
{ dest: 'AppIcon29x29@3x.png', width: 87, height: 87 },
{ dest: 'AppIcon40x40@2x.png', width: 80, height: 80 },
{ dest: 'AppIcon44x44@2x.png', width: 88, height: 88 },
{ dest: 'AppIcon86x86@2x.png', width: 172, height: 172 },
{ dest: 'AppIcon98x98@2x.png', width: 196, height: 196 }
];

var pathMap = {};
Expand Down Expand Up @@ -418,18 +418,18 @@ function cleanIcons (projectRoot, projectConfig, locations) {

function mapSplashScreenResources (splashScreens, splashScreensDir) {
var platformSplashScreens = [
{dest: 'Default~iphone.png', width: 320, height: 480},
{dest: 'Default@2x~iphone.png', width: 640, height: 960},
{dest: 'Default-Portrait~ipad.png', width: 768, height: 1024},
{dest: 'Default-Portrait@2x~ipad.png', width: 1536, height: 2048},
{dest: 'Default-Landscape~ipad.png', width: 1024, height: 768},
{dest: 'Default-Landscape@2x~ipad.png', width: 2048, height: 1536},
{dest: 'Default-568h@2x~iphone.png', width: 640, height: 1136},
{dest: 'Default-667h.png', width: 750, height: 1334},
{dest: 'Default-736h.png', width: 1242, height: 2208},
{dest: 'Default-Landscape-736h.png', width: 2208, height: 1242},
{dest: 'Default-2436h.png', width: 1125, height: 2436},
{dest: 'Default-Landscape-2436h.png', width: 2436, height: 1125}
{ dest: 'Default~iphone.png', width: 320, height: 480 },
{ dest: 'Default@2x~iphone.png', width: 640, height: 960 },
{ dest: 'Default-Portrait~ipad.png', width: 768, height: 1024 },
{ dest: 'Default-Portrait@2x~ipad.png', width: 1536, height: 2048 },
{ dest: 'Default-Landscape~ipad.png', width: 1024, height: 768 },
{ dest: 'Default-Landscape@2x~ipad.png', width: 2048, height: 1536 },
{ dest: 'Default-568h@2x~iphone.png', width: 640, height: 1136 },
{ dest: 'Default-667h.png', width: 750, height: 1334 },
{ dest: 'Default-736h.png', width: 1242, height: 2208 },
{ dest: 'Default-Landscape-736h.png', width: 2208, height: 1242 },
{ dest: 'Default-2436h.png', width: 1125, height: 2436 },
{ dest: 'Default-Landscape-2436h.png', width: 2436, height: 1125 }
];

var pathMap = {};
Expand Down Expand Up @@ -555,7 +555,7 @@ function cleanFileResources (projectRoot, projectConfig, locations) {
});

FileUpdater.updatePaths(
resourceMap, {rootDir: projectRoot, all: true}, logFileOp);
resourceMap, { rootDir: projectRoot, all: true }, logFileOp);

project.write();
}
Expand Down Expand Up @@ -1022,7 +1022,8 @@ function processAccessAndAllowNavigationEntries (config) {
null is returned if the URL cannot be parsed, or is to be skipped for ATS.
*/
function parseWhitelistUrlForATS (url, options) {
var href = URL.parse(url);
// @todo 'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead.
var href = URL.parse(url); // eslint-disable-line
var retObj = {};
retObj.Hostname = href.hostname;

Expand Down Expand Up @@ -1164,7 +1165,7 @@ function default_CFBundleVersion (version) {
// Converts cordova specific representation of target device to XCode value
function parseTargetDevicePreference (value) {
if (!value) return null;
var map = {'universal': '"1,2"', 'handset': '"1"', 'tablet': '"2"'};
var map = { 'universal': '"1,2"', 'handset': '"1"', 'tablet': '"2"' };
if (map[value.toLowerCase()]) {
return map[value.toLowerCase()];
}
Expand Down
2 changes: 1 addition & 1 deletion bin/templates/scripts/cordova/lib/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function (cmd, args, opt_cwd) {
"Use `require('cordova-common').superspawn` instead.");
var d = Q.defer();
try {
var child = proc.spawn(cmd, args, {cwd: opt_cwd, stdio: 'inherit'});
var child = proc.spawn(cmd, args, { cwd: opt_cwd, stdio: 'inherit' });

child.on('exit', function (code) {
if (code) {
Expand Down
33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/apache/cordova-ios"
},
"bugs": {
"url": "https://issues.apache.org/jira/browse/CB"
"url": "https://github.com/apache/cordova-ios/issues"
},
"keywords": [
"ios",
Expand All @@ -33,32 +33,31 @@
"author": "Apache Software Foundation",
"license": "Apache-2.0",
"devDependencies": {
"eslint": "^4.0.0",
"eslint-config-semistandard": "^11.0.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"eslint": "^5.12.0",
"eslint-config-semistandard": "^13.0.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"jasmine": "~3.1.0",
"nodeunit": "^0.8.7",
"nyc": "^12.0.2",
"nyc": "^13.1.0",
"rewire": "^4.0.1",
"tmp": "^0.0.26"
"tmp": "0.0.33"
},
"engines": {
"node": ">=6"
},
"engineStrict": true,
"dependencies": {
"cordova-common": "^3.0.0",
"ios-sim": "^6.1.2",
"nopt": "^3.0.6",
"plist": "^1.2.0",
"q": "^1.4.1",
"cordova-common": "^3.1.0",
"ios-sim": "^7.0.0",
"nopt": "^4.0.1",
"plist": "^3.0.1",
"q": "^1.5.1",
"shelljs": "^0.5.3",
"unorm": "^1.4.1",
"xcode": "^0.9.0",
"xcode": "^1.1.0",
"xml-escape": "^1.1.0"
},
"nyc": {
Expand Down
Loading