Rewrite install dir resolution for legacy plugins (#589)

* Improve target-dir restriction for detecting new android project structure used in plugin.xml. (#575)

* Clarify old source-file declaration way from the new one and improve ambiguous code.

* Better check `src/main` forms.

* Replace path search with RegExp vars.

* Fix RegExp in order to match `/` or `EOL`.

* Remove template strings for NodeJS 4 support (wanted in case we port these changes to `7.1.x` at some point).

* Add pointer to deprecation plan in GH-580.
This commit is contained in:
Jule-
2018-11-28 12:46:45 +01:00
committed by Chris Brody
parent ef2434188e
commit 8a4ae311ce
3 changed files with 35 additions and 13 deletions

View File

@@ -169,6 +169,12 @@ describe('android project handler', function () {
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin2.java', temp, path.join('app/src/main/java/com/appco/DummyPlugin2.java'), false);
});
it('Test#006k : should allow installing sources with target-dir that includes "app" in its first directory', function () {
android['source-file'].install(valid_source[11], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin2.java', temp, path.join('app/src/main/java/appco/src/DummyPlugin2.java'), false);
});
});
describe('of <framework> elements', function () {