-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Cherry picks #549
Cherry picks #549
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,14 +28,7 @@ var handlers = { | |
if (!obj.src) throw new CordovaError(generateAttributeError('src', 'source-file', plugin.id)); | ||
if (!obj.targetDir) throw new CordovaError(generateAttributeError('target-dir', 'source-file', plugin.id)); | ||
|
||
var dest = path.join(obj.targetDir, path.basename(obj.src)); | ||
|
||
// TODO: This code needs to be replaced, since the core plugins need to be re-mapped to a different location in | ||
// a later plugins release. This is for legacy plugins to work with Cordova. | ||
|
||
if (options && options.android_studio === true) { | ||
dest = studioPathRemap(obj); | ||
} | ||
var dest = getInstallDestination(obj); | ||
|
||
if (options && options.force) { | ||
copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link)); | ||
|
@@ -44,11 +37,8 @@ var handlers = { | |
} | ||
}, | ||
uninstall: function (obj, plugin, project, options) { | ||
var dest = path.join(obj.targetDir, path.basename(obj.src)); | ||
|
||
if (options && options.android_studio === true) { | ||
dest = studioPathRemap(obj); | ||
} | ||
var dest = getInstallDestination(obj); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as I made on line 31. Here is a much simpler change: @@ -47,7 +47,7 @@ var handlers = {
var dest = path.join(obj.targetDir, path.basename(obj.src));
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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// TODO: Add Koltin extension to uninstall, since they are handled like Java files | ||
if (obj.src.endsWith('java')) { | ||
|
@@ -317,6 +307,11 @@ function generateAttributeError (attribute, element, 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) { | ||
// If any source file is using the app new directory structure, | ||
// don't penalize it | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would downvote this change in a patch release, due to the potential to cause an upgrade issue. I would make a much simpler change here: