SamVerschueren / gulp-cordova-build-android

Gulp plugin for building an android Cordova project
MIT License
14 stars 10 forks source link

find outputs for ant-style builds #25

Closed djjanse closed 8 years ago

djjanse commented 8 years ago

Hi Sam, we still use ant style android builds for Cordova (by using the ANDROID_BUILD=ant env variable). The plugin cannot find the output apk's then, because for ant builds they are in the androidPath/bin directory. Could you include this fix in your package?

SamVerschueren commented 8 years ago

Thanks for the PR. Would it make sense to just check process.env.ANDROID_BUILD === 'ant' and then switch the directory? Or is it possible to trigger an ant build via another way as well? Not sure what the best approach would be to be honest, so feedback is always welcome.

If we go for the path exists call, use path-exists. fs.exists[Sync] is deprecated.

djjanse commented 8 years ago

I made an extra option in the API buildMethod. This way it's more explicit to choose the build method. As an alternative the environment variable ANDROID_BUILDcan be used, however the buildMethod option takes precedence.

SamVerschueren commented 8 years ago

Nice, looks good! Added some extra notes. Will merge after you fixed them :)

djjanse commented 8 years ago

Fixed the formatting. Thank for you comments!

SamVerschueren commented 8 years ago

Just one more. Need to add a linter and tests to catch this asap :).

djjanse commented 8 years ago

OK, found still one more :-). Yes, linting and tests would be nice. If I find the time, I'll be happy to help you with that.

SamVerschueren commented 8 years ago

@djjanse Thank you very much! Released as 1.5.1.

I'm all open for PR on linting, testing and all other improvements you can think of. gulp-cordova-plugin has all of that so it might be useful as inspiration. I'm also going to drop support for node 0.10 and 0.12. It would clean up the code drastically with ES2015 features like fat-arrow functions.