Skip to content

Commit

Permalink
Fix Java tests for older Gradle versions
Browse files Browse the repository at this point in the history
Before this, Gradle 4.4 was required to build the Gradle wrapper and
thus run the Java tests. This was because of all the stuff that had to
be configured when running the wrapper task using the build.gradle file.

Now we use a config file that only specifies the required Gradle version
and nothing else to run the wrapper task. This allows tests to be run
with Gradle versions beginning with 2.
  • Loading branch information
raphinesse committed Jun 13, 2018
1 parent 0d4b9f4 commit a254cfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/run_java_unit_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var superspawn = require('cordova-common').superspawn;
// First we make sure the gradlew helper file is built and ready.
var GradleBuilder = require('../bin/templates/cordova/lib/builders/GradleBuilder');
var builder = new GradleBuilder(__dirname);
var needs_gradlew_built = builder.runGradleWrapper('gradle', 'build.gradle');
var needs_gradlew_built = builder.runGradleWrapper('gradle');

if (!needs_gradlew_built) {
// Due to interface of gradle builder, if the gradlew file already exists, `runGradleWrapper` returns undefined.
Expand Down
3 changes: 3 additions & 0 deletions test/wrapper.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapper {
gradleVersion = '4.4.1'
}

0 comments on commit a254cfc

Please sign in to comment.