From commits-return-52292-archive-asf-public=cust-asf.ponee.io@cordova.apache.org Tue Feb 27 13:43:25 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 77D301807C2 for ; Tue, 27 Feb 2018 13:43:22 +0100 (CET) Received: (qmail 2475 invoked by uid 500); 27 Feb 2018 12:43:21 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 2428 invoked by uid 99); 27 Feb 2018 12:43:21 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Feb 2018 12:43:21 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id AFC6A8258D; Tue, 27 Feb 2018 12:43:19 +0000 (UTC) Date: Tue, 27 Feb 2018 12:43:42 +0000 To: "commits@cordova.apache.org" Subject: [cordova-windows] 24/26: general comments and TODO MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: janpio@apache.org In-Reply-To: <151973539893.4926.11340097970257716432@gitbox.apache.org> References: <151973539893.4926.11340097970257716432@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: cordova-windows X-Git-Refname: refs/heads/janpio-win10only X-Git-Reftype: branch X-Git-Rev: babd839bc2590b27c584d29ee6a86c5245746917 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180227124319.AFC6A8258D@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. janpio pushed a commit to branch janpio-win10only in repository https://gitbox.apache.org/repos/asf/cordova-windows.git commit babd839bc2590b27c584d29ee6a86c5245746917 Author: Jan Piotrowski AuthorDate: Fri Feb 16 13:56:00 2018 +0100 general comments and TODO --- bin/lib/check_reqs.js | 2 +- template/cordova/lib/build.js | 10 ++++++---- template/cordova/lib/deployment.js | 2 ++ template/cordova/lib/package.js | 2 +- template/cordova/lib/run.js | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js index aca562b..61f1075 100644 --- a/bin/lib/check_reqs.js +++ b/bin/lib/check_reqs.js @@ -347,7 +347,7 @@ module.exports.isWinSDKPresent = function (target_platform) { // Checks if min SDK required to build Windows Phone 8.1 project is present module.exports.isPhoneSDKPresent = function () { - return checkPhoneSdk('8.1', '8.1'); + return checkPhoneSdk('8.1', '8.1'); // TODO }; /** diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js index 52c0c28..37ead69 100644 --- a/template/cordova/lib/build.js +++ b/template/cordova/lib/build.js @@ -84,6 +84,8 @@ module.exports.run = function run (buildOptions) { function getBuildTargets (isWinSwitch, isPhoneSwitch, buildConfig) { buildConfig = typeof buildConfig !== 'undefined' ? buildConfig : null; + // TODO This whole method can be super simplified as there is only one target + var configXML = new ConfigParser(path.join(ROOT, 'config.xml')); var targets = []; var noSwitches = !(isPhoneSwitch || isWinSwitch); @@ -337,6 +339,10 @@ function buildTargets (config, myBuildTargets, msbuild) { if (shouldBundle) { return buildsCompleted.then(function () { + // msbuild isn't capable of generating bundles unless you enable bundling for each individual arch + // However, that generates intermediate bundles, like "CordovaApp.Windows10_0.0.1.0_x64.appxbundle" + // We need to clear the intermediate bundles, or else "cordova run" will fail because of too + // many .appxbundle files. return clearIntermediatesAndGetPackage(bundleTerms, config, hasAnyCpu); }); } else { @@ -347,10 +353,6 @@ function buildTargets (config, myBuildTargets, msbuild) { } function clearIntermediatesAndGetPackage (bundleTerms, config, hasAnyCpu) { - // msbuild isn't capable of generating bundles unless you enable bundling for each individual arch - // However, that generates intermediate bundles, like "CordovaApp.Windows10_0.0.1.0_x64.appxbundle" - // We need to clear the intermediate bundles, or else "cordova run" will fail because of too - // many .appxbundle files. events.emit('verbose', 'Clearing intermediates...'); var appPackagesPath = path.join(ROOT, 'AppPackages'); var childDirectories = shell.ls(path.join(appPackagesPath, '*')).map(function (pathName) { diff --git a/template/cordova/lib/deployment.js b/template/cordova/lib/deployment.js index 5394e74..0efebc0 100644 --- a/template/cordova/lib/deployment.js +++ b/template/cordova/lib/deployment.js @@ -110,6 +110,8 @@ DeviceInfo.prototype.toString = function () { return this.index + '. ' + this.name + ' (' + this.type + ')'; }; +// Deploy to Phone + function AppDeployCmdTool (targetOsVersion) { if (!(this instanceof AppDeployCmdTool)) { throw new ReferenceError('Only create an AppDeployCmdTool as an instance object.'); } diff --git a/template/cordova/lib/package.js b/template/cordova/lib/package.js index 84a1f6e..4cb6226 100644 --- a/template/cordova/lib/package.js +++ b/template/cordova/lib/package.js @@ -88,7 +88,7 @@ module.exports.getPackageFileInfo = function (packageFile) { var props = /.*\.(Phone|Windows|Windows10)_((?:\d*\.)*\d*)*((?:_(AnyCPU|x86|x64|ARM)){1,4})(?:(_Debug))?.(appx|appxbundle)$/i.exec(pkgName); if (props) { return { - type: props[1].toLowerCase(), + type: props[1].toLowerCase(), // TODO remove as this can be phone, windows or windows10 arch: props[3].toLowerCase().substring(1), archs: props[3].toLowerCase().substring(1).split('_'), buildtype: props[5] ? props[5].substring(1).toLowerCase() : 'release', diff --git a/template/cordova/lib/run.js b/template/cordova/lib/run.js index 2d7b869..98e69fc 100644 --- a/template/cordova/lib/run.js +++ b/template/cordova/lib/run.js @@ -58,12 +58,13 @@ module.exports.run = function (options) { // Get build/deploy options var buildType = options.release ? 'release' : 'debug'; + // CB-11478 Allow to specify 'archs' parameter as either cli or platform // option i.e. 'cordova run --archs' vs. 'cordova run -- --archs' var archs = options.archs || args.archs || ['anycpu']; if (typeof archs === 'string') { archs = archs.split(' '); } - var buildArchs = archs.map(function (arch) { return arch.toLowerCase(); }); + var deployTarget = options.target ? options.target : (options.emulator ? 'emulator' : 'device'); var buildTargets = build.getBuildTargets(args.win, args.phone); -- To stop receiving notification emails like this one, please contact janpio@apache.org. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org