mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
CB-13612: Fix the remapper so that XML files copy over and the Camera works again.
This commit is contained in:
parent
0269e532df
commit
a9e01f4309
13
bin/templates/cordova/lib/pluginHandlers.js
vendored
13
bin/templates/cordova/lib/pluginHandlers.js
vendored
@ -30,8 +30,19 @@ var handlers = {
|
|||||||
|
|
||||||
var dest = path.join(obj.targetDir, path.basename(obj.src));
|
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) {
|
if (options && options.android_studio === true) {
|
||||||
dest = path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
|
// If a Java file is using the new directory structure, don't penalize it
|
||||||
|
if (!obj.targetDir.includes('app/src/main')) {
|
||||||
|
if (obj.src.endsWith('.java')) {
|
||||||
|
dest = path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
|
||||||
|
} else if (obj.src.endsWith('.xml')) {
|
||||||
|
// We are making a huge assumption here that XML files will be going to res/xml or values/xml
|
||||||
|
dest = path.join('app/src/main', obj.targetDir, path.basename(obj.src));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options && options.force) {
|
if (options && options.force) {
|
||||||
|
Loading…
Reference in New Issue
Block a user