unit test source-file with custom lib target-dir (PR #542)

for JAR and AAR

(GH-540)

Co-Authored-By: Kyle Kirbatski <kkirbatski@gmrmarketing.com>
Co-Authored-By: Christopher J. Brody <chris.brody@gmail.com>
Co-Authored-By: @afdev82 (Antonio Facciolo)
This commit is contained in:
Christopher J. Brody 2018-11-09 14:43:47 -05:00
parent 4d151d3057
commit f8584c63e6
3 changed files with 18 additions and 0 deletions

View File

@ -72,6 +72,10 @@
target-dir="src/com/phonegap/plugins/dummyplugin" /> target-dir="src/com/phonegap/plugins/dummyplugin" />
<source-file src="src/android/DummyPlugin2.java" <source-file src="src/android/DummyPlugin2.java"
target-dir="app/src/main/src/com/phonegap/plugins/dummyplugin" /> target-dir="app/src/main/src/com/phonegap/plugins/dummyplugin" />
<source-file src="src/android/TestLib.jar"
target-dir="app/libs" />
<source-file src="src/android/TestAar.aar"
target-dir="app/libs" />
<lib-file src="src/android/TestLib.jar" /> <lib-file src="src/android/TestLib.jar" />
</platform> </platform>
</plugin> </plugin>

View File

@ -0,0 +1 @@
./org.test.plugins.dummyplugin/src/android/TestAar.aar

View File

@ -114,6 +114,19 @@ describe('android project handler', function () {
expect(copyFileSpy) expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin2.java', temp, path.join('app/src/main/src/com/phonegap/plugins/dummyplugin/DummyPlugin2.java'), false); .toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin2.java', temp, path.join('app/src/main/src/com/phonegap/plugins/dummyplugin/DummyPlugin2.java'), false);
}); });
// TODO: renumber these tests and other tests below
it('Test#007a : should allow installing lib file from sources using proper path', function () {
android['source-file'].install(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestLib.jar', temp, path.join('app/libs/TestLib.jar'), false);
});
it('Test#007b : should allow installing aar file from sources using proper path', function () {
android['source-file'].install(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestAar.aar', temp, path.join('app/libs/TestAar.aar'), false);
});
}); });
describe('of <framework> elements', function () { describe('of <framework> elements', function () {