[
https://issues.apache.org/jira/browse/CB-8954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14559587#comment-14559587
]
ASF GitHub Bot commented on CB-8954:
------------------------------------
Github user TimBarham commented on a diff in the pull request:
https://github.com/apache/cordova-android/pull/176#discussion_r31065606
--- Diff: bin/lib/check_reqs.js ---
@@ -70,18 +72,23 @@ module.exports.get_target = function() {
// Returns a promise. Called only by build and clean commands.
module.exports.check_ant = function() {
- return tryCommand('ant -version', 'Failed to run "ant -version", make
sure you have ant installed and added to your PATH.');
+ return tryCommand('ant -version', 'Failed to run "ant -version", make
sure you have ant installed and added to your PATH.')
+ .then(function (output) {
+ // Parse Ant version from command output
+ return /version ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
+ });
};
// Returns a promise. Called only by build and clean commands.
module.exports.check_gradle = function() {
var sdkDir = process.env['ANDROID_HOME'];
- var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle',
'wrapper');
- if (!fs.existsSync(wrapperDir)) {
- return Q.reject(new Error('Could not find gradle wrapper within
android sdk. Might need to update your Android SDK.\n' +
- 'Looked here: ' + wrapperDir));
- }
- return Q.when();
+ var wrapper = path.join(sdkDir, 'tools', 'templates', 'gradle',
'wrapper', 'gradlew');
--- End diff --
If `ANDROID_HOME` is not defined, the error you will get here is:
Gradle: not installed
[TypeError: Arguments to path.join must be strings]
(since you end up passing null to `path.join()`)
While there is a previous check for `ANDROID_HOME` (as part of the Android
SDK check), it would be nice to make this error more meaningful.
> Update platform check_reqs script to return structured result to
> 'requirements' command
> ---------------------------------------------------------------------------------------
>
> Key: CB-8954
> URL: https://issues.apache.org/jira/browse/CB-8954
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android, iOS, Windows, WP8
> Reporter: Vladimir Kotikov
> Assignee: Vladimir Kotikov
>
> Since {{requirements}} LIB method assumes that underlying platform script
> will be {{require}}d instead of spawning child process and capturing output,
> we need to modify these scripts to provide method that will be called for
> getting current requirements status.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]