You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2017/11/30 18:57:56 UTC

[cordova-android] 03/04: CB-13621: Wrote similar warning to CB-12948 on iOS. We no longer support update.

This is an automated email from the ASF dual-hosted git repository.

bowserj pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/cordova-android.git

commit 655c0182726087fc13f6c5d30c5e8b736a7e78b8
Author: Joe Bowser <bo...@apache.org>
AuthorDate: Thu Nov 30 10:40:07 2017 -0800

    CB-13621: Wrote similar warning to CB-12948 on iOS.  We no longer support update.
---
 bin/lib/create.js | 45 +++++++++++----------------------------------
 1 file changed, 11 insertions(+), 34 deletions(-)

diff --git a/bin/lib/create.js b/bin/lib/create.js
index c96ea6c..7e39f87 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -348,39 +348,16 @@ function generateDoneMessage (type, link) {
 
 // Returns a promise.
 exports.update = function (projectPath, options, events) {
-    options = options || {};
-
-    return Q()
-        .then(function () {
 
-            var isAndroidStudio = AndroidStudio.isAndroidStudioProject(projectPath);
-            var isLegacy = !isAndroidStudio;
-            var manifest = null;
-            var builder = 'gradle';
-
-            if (isAndroidStudio) {
-                manifest = new AndroidManifest(path.join(projectPath, 'app', 'main', 'AndroidManifest.xml'));
-                builder = 'studio';
-            } else {
-                manifest = new AndroidManifest(path.join(projectPath, 'AndroidManifest.xml'));
-                builder = 'gradle';
-            }
-
-            if (Number(manifest.getMinSdkVersion()) < MIN_SDK_VERSION) {
-                events.emit('verbose', 'Updating minSdkVersion to ' + MIN_SDK_VERSION + ' in AndroidManifest.xml');
-                manifest.setMinSdkVersion(MIN_SDK_VERSION);
-            }
-
-            manifest.setDebuggable(false).write();
-
-            var projectName = manifest.getActivity().getName();
-            var target_api = check_reqs.get_target();
-
-            exports.copyJsAndLibrary(projectPath, options.link, projectName, isLegacy);
-            exports.copyScripts(projectPath);
-            exports.copyBuildRules(projectPath, isLegacy);
-            exports.writeProjectProperties(projectPath, target_api);
-            exports.prepBuildFiles(projectPath, builder);
-            events.emit('log', generateDoneMessage('update', options.link));
-        }).thenResolve(projectPath);
+  var errorString =
+    'An in-place platform update is not supported. \n' +
+    'The `platforms` folder is always treated as a build artifact in the CLI workflow.\n' +
+    'To update your platform, you have to remove, then add your android platform again.\n' +
+    'Make sure you save your plugins beforehand using `cordova plugin save`, and save \n' + 'a copy of the platform first if you had manual changes in it.\n' +
+    '\tcordova plugin save\n' +
+    '\tcordova platform rm android\n' +
+    '\tcordova platform add android\n'
+    ;
+
+    return Q.reject(errorString);
 };

-- 
To stop receiving notification emails like this one, please contact
"commits@cordova.apache.org" <co...@cordova.apache.org>.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org