mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-01 14:33:00 +08:00
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:
parent
5222a0f605
commit
e3468c66a3
@ -76,6 +76,7 @@
|
|||||||
target-dir="app/libs" />
|
target-dir="app/libs" />
|
||||||
<source-file src="src/android/TestAar.aar"
|
<source-file src="src/android/TestAar.aar"
|
||||||
target-dir="app/libs" />
|
target-dir="app/libs" />
|
||||||
|
<source-file src="src/android/mysettings.xml" target-dir="res/xml" />
|
||||||
<lib-file src="src/android/TestLib.jar" />
|
<lib-file src="src/android/TestLib.jar" />
|
||||||
</platform>
|
</platform>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
1
spec/fixtures/org.test.plugins.dummyplugin/src/android/mysettings.xml
vendored
Normal file
1
spec/fixtures/org.test.plugins.dummyplugin/src/android/mysettings.xml
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
dummy
|
@ -127,6 +127,13 @@ describe('android project handler', function () {
|
|||||||
expect(copyFileSpy)
|
expect(copyFileSpy)
|
||||||
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestAar.aar', temp, path.join('app/libs/TestAar.aar'), false);
|
.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 () {
|
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});
|
android['source-file'].uninstall(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
|
||||||
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestAar.aar'));
|
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 () {
|
describe('of <framework> elements', function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user