forked from github/cordova-android
The prepare step was broken, which breaks the CLI workflow. This was caused by hardcoding the Java directory, which is a very bad idea.
This commit is contained in:
parent
1cda7a9de0
commit
b20028c42b
3
bin/templates/cordova/Api.js
vendored
3
bin/templates/cordova/Api.js
vendored
@ -74,6 +74,7 @@ function Api(platform, platformRootDir, events) {
|
||||
strings: path.join(self.root, 'res/values/strings.xml'),
|
||||
manifest: path.join(self.root, 'AndroidManifest.xml'),
|
||||
build: path.join(self.root, 'build'),
|
||||
javaSrc: path.join(self.root, 'src'),
|
||||
// NOTE: Due to platformApi spec we need to return relative paths here
|
||||
cordovaJs: 'bin/templates/project/assets/www/cordova.js',
|
||||
cordovaJsSrc: 'cordova-js-src'
|
||||
@ -87,6 +88,8 @@ function Api(platform, platformRootDir, events) {
|
||||
this.locations.configXml = path.join(self.root, 'app/src/main/res/xml/config.xml');
|
||||
this.locations.strings = path.join(self.root, 'app/src/main/res/values/strings.xml');
|
||||
this.locations.manifest = path.join(self.root, 'app/src/main/AndroidManifest.xml');
|
||||
//We could have Java Source, we could have other languages
|
||||
this.locations.javaSrc = path.join(self.root, 'app/src/main/java/');
|
||||
this.locations.www = path.join(self.root, 'app/src/main/assets/www');
|
||||
this.locations.res = path.join(self.root, 'app/src/main/res');
|
||||
}
|
||||
|
4
bin/templates/cordova/lib/prepare.js
vendored
4
bin/templates/cordova/lib/prepare.js
vendored
@ -193,7 +193,9 @@ function updateProjectAccordingTo(platformConfig, locations) {
|
||||
.setTargetSdkVersion(platformConfig.getPreference('android-targetSdkVersion', 'android'))
|
||||
.write();
|
||||
|
||||
var javaPattern = path.join(locations.root, 'src', orig_pkg.replace(/\./g, '/'), '*.java');
|
||||
//Java file paths shouldn't be hard coded
|
||||
var javaPattern = path.join(locations.javaSrc, orig_pkg.replace(/\./g, '/'), '*.java');
|
||||
|
||||
var java_files = shell.ls(javaPattern).filter(function(f) {
|
||||
return shell.grep(/extends\s+CordovaActivity/g, f);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user