From eb868d03f8b84e626e75f015132c8d480d93e7a7 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Thu, 15 Nov 2018 06:58:33 -0500 Subject: [PATCH] Remove GH-547 update for aidl files GH-547 update for aidl files was breaking installation of https://github.com/j3k0/cordova-plugin-purchase#master (v7.2.4) --- bin/templates/cordova/lib/pluginHandlers.js | 2 -- spec/unit/pluginHandlers/handlers.spec.js | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/templates/cordova/lib/pluginHandlers.js b/bin/templates/cordova/lib/pluginHandlers.js index 794154b547..217bd61a12 100644 --- a/bin/templates/cordova/lib/pluginHandlers.js +++ b/bin/templates/cordova/lib/pluginHandlers.js @@ -301,8 +301,6 @@ function getInstallDestination (obj) { return path.join(obj.targetDir, path.basename(obj.src)); } else if (obj.src.endsWith('.java')) { return path.join(APP_MAIN_PREFIX, 'java', obj.targetDir.substring(4), path.basename(obj.src)); - } else if (obj.src.endsWith('.aidl')) { - return path.join(APP_MAIN_PREFIX, 'aidl', obj.targetDir.substring(4), path.basename(obj.src)); } else if (obj.targetDir.includes('libs')) { if (obj.src.endsWith('.so')) { return path.join(APP_MAIN_PREFIX, 'jniLibs', obj.targetDir.substring(5), path.basename(obj.src)); diff --git a/spec/unit/pluginHandlers/handlers.spec.js b/spec/unit/pluginHandlers/handlers.spec.js index 20f5e6e93b..4112ca653c 100644 --- a/spec/unit/pluginHandlers/handlers.spec.js +++ b/spec/unit/pluginHandlers/handlers.spec.js @@ -136,11 +136,12 @@ describe('android project handler', function () { path.join('app/src/main/res/values/other.extension'), false); }); - it('Test#006f : should allow installing aidl file from sources with old target-dir scheme (GH-547)', function () { + it('Test#006f : should allow installing aidl file from sources with old target-dir scheme - GH-547 fix removed', function () { + // GH-547 fix removed to avoid breaking plugins such as cordova-plugin-purchase android['source-file'].install(valid_source[6], dummyPluginInfo, dummyProject, {android_studio: true}); expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'src/android/myapi.aidl', temp, - path.join('app/src/main/aidl/com/mytest/myapi.aidl'), false); + path.join('app/src/main/src/com/mytest/myapi.aidl'), false); }); it('Test#006g : should allow installing aar lib file from sources with old target-dir scheme (GH-547)', function () { @@ -349,10 +350,11 @@ describe('android project handler', function () { expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/res/values/other.extension')); }); - it('Test#019f : should remove stuff by calling common.removeFile for Android Studio projects, of aidl with old target-dir scheme (GH-547)', function () { + it('Test#019f : should remove stuff by calling common.removeFile for Android Studio projects, of aidl with old target-dir scheme - GH-547 fix removed', function () { + // GH-547 fix removed to avoid breaking plugins such as cordova-plugin-purchase android['source-file'].install(valid_source[6], dummyPluginInfo, dummyProject, {android_studio: true}); android['source-file'].uninstall(valid_source[6], dummyPluginInfo, dummyProject, {android_studio: true}); - expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/aidl/com/mytest/myapi.aidl')); + expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/src/com/mytest/myapi.aidl')); }); it('Test#019g : should remove stuff by calling common.removeFile for Android Studio projects, of aar with old target-dir scheme (GH-547)', function () {