Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CA010200D2F for ; Wed, 18 Oct 2017 01:07:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C89131609EB; Tue, 17 Oct 2017 23:07:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 195191609EC for ; Wed, 18 Oct 2017 01:07:12 +0200 (CEST) Received: (qmail 19188 invoked by uid 500); 17 Oct 2017 23:07:12 -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 19179 invoked by uid 99); 17 Oct 2017 23:07:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2017 23:07:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 55A99DF9E6; Tue, 17 Oct 2017 23:07:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Tue, 17 Oct 2017 23:07:12 -0000 Message-Id: In-Reply-To: <26ef14e6bc4842c2bcecd23e2658384b@git.apache.org> References: <26ef14e6bc4842c2bcecd23e2658384b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] cordova-common git commit: CB-11244: Spot fix for cordova-android PR #389 archived-at: Tue, 17 Oct 2017 23:07:14 -0000 CB-11244: Spot fix for cordova-android PR #389 Project: http://git-wip-us.apache.org/repos/asf/cordova-common/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-common/commit/8b643096 Tree: http://git-wip-us.apache.org/repos/asf/cordova-common/tree/8b643096 Diff: http://git-wip-us.apache.org/repos/asf/cordova-common/diff/8b643096 Branch: refs/heads/master Commit: 8b6430960e8aa6f1ef51e3ad218b11b773f89b1a Parents: 7f4e5d7 Author: Joe Bowser Authored: Mon Oct 2 14:00:46 2017 -0700 Committer: Steve Gill Committed: Mon Oct 16 17:00:31 2017 -0700 ---------------------------------------------------------------------- src/ConfigChanges/ConfigFile.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-common/blob/8b643096/src/ConfigChanges/ConfigFile.js ---------------------------------------------------------------------- diff --git a/src/ConfigChanges/ConfigFile.js b/src/ConfigChanges/ConfigFile.js index a4a7331..330f2c1 100644 --- a/src/ConfigChanges/ConfigFile.js +++ b/src/ConfigChanges/ConfigFile.js @@ -184,16 +184,29 @@ function resolveConfigFilePath (project_dir, platform, file) { return filepath; } - // special-case config.xml target that is just "config.xml". This should be resolved to the real location of the file. - // TODO: move the logic that contains the locations of config.xml from cordova CLI into plugman. + // XXX this checks for android studio projects + // only if none of the options above are satisfied does this get called + // TODO: Move this out of cordova-common and into the platforms somehow + if (platform === 'android' && !fs.existsSync(filepath)) { + if(file === 'AndroidManifest.xml') { + filepath = path.join(project_dir, 'app', 'src', 'main', 'AndroidManifest.xml'); + } else if(file.endsWith('config.xml')) { + filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml'); + } else if(file.endsWith('strings.xml')) { + filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'values', 'strings.xml'); + } + return filepath; + } + + // special-case config.xml target that is just "config.xml" for other platforms. This should + // be resolved to the real location of the file. + // TODO: Move this out of cordova-common into platforms if (file === 'config.xml') { if (platform === 'ubuntu') { filepath = path.join(project_dir, 'config.xml'); } else if (platform === 'ios') { var iospath = getIOSProjectname(project_dir); filepath = path.join(project_dir, iospath, 'config.xml'); - } else if (platform === 'android') { - filepath = path.join(project_dir, 'res', 'xml', 'config.xml'); } else { matches = modules.glob.sync(path.join(project_dir, '**', 'config.xml')); if (matches.length) filepath = matches[0]; @@ -201,12 +214,6 @@ function resolveConfigFilePath (project_dir, platform, file) { return filepath; } - // XXX this checks for android studio projects - // only if none of the options above are satisfied does this get called - if (platform === 'android' && !fs.existsSync(filepath)) { - filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml'); - } - // None of the special cases matched, returning project_dir/file. return filepath; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org