mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-28 22:17:50 +08:00
GH-539 fix destination path fallback (PR #542)
Fallback to old path mapping if no Android Studio path mapping exists (with slight difference on 7.1.x branch) Co-authored-by: Christopher J. Brody <chris.brody@gmail.com> Co-authored-by: Kyle Kirbatski <kkirbatski@gmrmarketing.com>
This commit is contained in:
parent
55f2986b85
commit
4d151d3057
9
bin/templates/cordova/lib/pluginHandlers.js
vendored
9
bin/templates/cordova/lib/pluginHandlers.js
vendored
@ -34,7 +34,7 @@ var handlers = {
|
|||||||
// a later plugins release. This is for legacy plugins to work with Cordova.
|
// a later plugins release. This is for legacy plugins to work with Cordova.
|
||||||
|
|
||||||
if (options && options.android_studio === true) {
|
if (options && options.android_studio === true) {
|
||||||
dest = studioPathRemap(obj);
|
dest = getInstallDestination(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options && options.force) {
|
if (options && options.force) {
|
||||||
@ -47,7 +47,7 @@ var handlers = {
|
|||||||
var dest = path.join(obj.targetDir, path.basename(obj.src));
|
var dest = path.join(obj.targetDir, path.basename(obj.src));
|
||||||
|
|
||||||
if (options && options.android_studio === true) {
|
if (options && options.android_studio === true) {
|
||||||
dest = studioPathRemap(obj);
|
dest = getInstallDestination(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Add Koltin extension to uninstall, since they are handled like Java files
|
// TODO: Add Koltin extension to uninstall, since they are handled like Java files
|
||||||
@ -317,6 +317,11 @@ function generateAttributeError (attribute, element, id) {
|
|||||||
return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
|
return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getInstallDestination (obj) {
|
||||||
|
return studioPathRemap(obj) ||
|
||||||
|
path.join(obj.targetDir, path.basename(obj.src));
|
||||||
|
}
|
||||||
|
|
||||||
function studioPathRemap (obj) {
|
function studioPathRemap (obj) {
|
||||||
// If a Java file is using the new directory structure, don't penalize it
|
// If a Java file is using the new directory structure, don't penalize it
|
||||||
if (!obj.targetDir.includes('app/src/main')) {
|
if (!obj.targetDir.includes('app/src/main')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user