[
https://issues.apache.org/jira/browse/CB-9389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14633470#comment-14633470
]
Sergey Grebnov commented on CB-9389:
------------------------------------
I think we should add logic to check whether Gradle_Home is set and use
corresponding value to test gradle version instead of default location.
> Android. Fix Gradle requirements test
> -------------------------------------
>
> Key: CB-9389
> URL: https://issues.apache.org/jira/browse/CB-9389
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Reporter: Sergey Grebnov
>
> Cordova Android on Windows10:
> After switching to the latest Cordova from master I noticed that Android
> build hangs after the following line
> JAVA_HOME=c:\Program Files (x86)\Java\jdk1.8.0_11
> After adding additional logging I found out that it hangs internally on the
> following check:
> {code}
> tryCommand: "c:\tools\android-sdk\sdk\tools\templates\gradle\wrapper\gradlew"
> -v
> {code}
> Looks like this command tries to download gradle wrapper (PS. version also
> looks old)
> {code}
> λ "c:\tools\android-sdk\sdk\tools\templates\gradle\wrapper\gradlew" -v
> Downloading http://services.gradle.org/distributions/gradle-1.12-all.zip
> .....................................................................................................................
> {code}
> even if I have gradle tools installed and correctly set GRADLE_HOME
> environment variable:
> {code}
> C:\Users\Sergei
> λ echo %gradle_home%
> C:\tools\gradle-2.3\
> {code}
> Here is corresponding logic in check_regs.js:
> {code}
> // Returns a promise. Called only by build and clean commands.
> module.exports.check_gradle = function() {
> var sdkDir = process.env['ANDROID_HOME'];
> var message = 'Could not find gradle wrapper within Android SDK. ';
> if (!sdkDir) return Q.reject(message + 'Might need to install Android SDK
> or set up \'ADROID_HOME\' env variable.');
> var wrapper = path.join(sdkDir, 'tools', 'templates', 'gradle',
> 'wrapper', 'gradlew');
> return tryCommand('"' + wrapper + '" -v', message + 'Might need to update
> your Android SDK.\n' +
> 'Looked here: ' + path.dirname(wrapper))
> .then(function (output) {
> // Parse Gradle version from command output
> return/^gradle ((?:\d+\.)+(?:\d+))/gim.exec(output)[1];
> });
> };
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]