Skip to content

Commit

Permalink
Check target-dir mapping of plugin xml source file
Browse files Browse the repository at this point in the history
Possibly related to: CB-13830: Add handlers for plugins
that use non-Java source files, such as Camera
  • Loading branch information
Christopher J. Brody committed Nov 13, 2018
1 parent 9d03e4e commit 578a642
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/fixtures/org.test.plugins.dummyplugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
target-dir="app/libs" />
<source-file src="src/android/TestAar.aar"
target-dir="app/libs" />
<source-file src="src/android/mysettings.xml" target-dir="res/xml" />
<lib-file src="src/android/TestLib.jar" />
</platform>
</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummy
13 changes: 13 additions & 0 deletions spec/unit/pluginHandlers/handlers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ describe('android project handler', function () {
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestAar.aar', temp, path.join('app/libs/TestAar.aar'), false);
});

it('Test#006d : should allow installing xml file from sources with old target-dir scheme', function () {
android['source-file'].install(valid_source[4], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/mysettings.xml', temp,
path.join('app/src/main/res/xml/mysettings.xml'), false);
});
});

describe('of <framework> elements', function () {
Expand Down Expand Up @@ -294,6 +301,12 @@ describe('android project handler', function () {
android['source-file'].uninstall(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestAar.aar'));
});

it('Test#019d : should remove stuff by calling common.removeFile for Android Studio projects, of xml with old target-dir scheme', function () {
android['source-file'].install(valid_source[4], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[4], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/res/xml/mysettings.xml'));
});
});

describe('of <framework> elements', function () {
Expand Down

0 comments on commit 578a642

Please sign in to comment.