Check target-dir mapping of plugin xml source file (PR #550)

Possibly related to: CB-13830: Add handlers for plugins
that use non-Java source files, such as Camera
This commit is contained in:
Christopher J. Brody 2018-11-12 21:50:20 -05:00
parent 5222a0f605
commit e3468c66a3
3 changed files with 15 additions and 0 deletions

View File

@ -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>

View File

@ -0,0 +1 @@
dummy

View File

@ -127,6 +127,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 () {
@ -300,6 +307,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 () {