Skip to content

Commit cb9089c

Browse files
authored
Merge pull request exercism#599 from exercism/gradle-wrapper
Use Gradle wrapper for CI jobs
2 parents 6208d8f + af9584e commit cb9089c

8 files changed

Lines changed: 282 additions & 8 deletions

File tree

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ build/
88
*.iml
99
bin/configlet
1010
bin/configlet.exe
11-
gradle/
1211
/exercises/.nb-gradle/

‎.travis.yml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ notifications:
1313

1414
# http://docs.travis-ci.com/user/migrating-from-legacy
1515
sudo: false
16-
cache: bundler
16+
1717
addons:
1818
apt:
1919
packages:
@@ -24,9 +24,23 @@ before_install:
2424
- rvm use 2.2.5
2525
- bin/build-jq.sh # we want jq 1.5 features; not avail through pkg repo.
2626

27+
# https://docs.travis-ci.com/user/customizing-the-build#Skipping-the-Installation-Step
28+
install: true # if we don't skip install, ./gradlew assemble is invoked, but this task is not available.
29+
2730
before_script:
2831
- export PATH=$TRAVIS_BUILD_DIR/bin:$PATH # ensure our tools are prefered over included ones.
2932

3033
script:
3134
- bin/unit-tests.sh
3235
- bin/journey-test.sh
36+
37+
# configure caching (https://docs.travis-ci.com/user/languages/java/#Caching)
38+
before_cache:
39+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
40+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
41+
# format from https://docs.travis-ci.com/user/caching/#Enabling-multiple-caching-features
42+
cache:
43+
bundler: true
44+
directories:
45+
- $HOME/.gradle/caches/
46+
- $HOME/.gradle/wrapper/

‎bin/journey-test.sh‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ clean() {
5959
rm -rf "${build_path}"
6060
fi
6161
cd exercises
62-
gradle clean
62+
"$EXECPATH"/gradlew clean
6363
cd ..
6464
echo "<<< clean()"
6565
}
@@ -227,12 +227,12 @@ solve_all_exercises() {
227227

228228
pushd ${exercism_exercises_dir}/java/${exercise}
229229
# Check that tests compile before we strip @Ignore annotations
230-
gradle compileTestJava
230+
"$EXECPATH"/gradlew compileTestJava
231231
# Ensure we run all the tests (as delivered, all but the first is @Ignore'd)
232232
for testfile in `find . -name "*Test.java"`; do
233233
sed 's/@Ignore\(.*\)//' ${testfile} > "${tempfile}" && mv "${tempfile}" "${testfile}"
234234
done
235-
gradle test
235+
"$EXECPATH"/gradlew test
236236
popd
237237

238238
current_exercise_number=$((current_exercise_number + 1))
@@ -256,7 +256,6 @@ main() {
256256
local xapi_port=9292
257257

258258
# fail fast if required binaries are not installed.
259-
assert_installed "gradle"
260259
assert_installed "jq"
261260

262261
clean "${build_dir}"

‎bin/unit-tests.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
set -e
3-
gradle --version
3+
./gradlew --version
44

55
echo ""
66
echo ">>> Running configlet..."
@@ -10,6 +10,6 @@ bin/configlet .
1010
pushd exercises
1111
echo ""
1212
echo ">>> Running tests..."
13-
TERM=dumb gradle check compileStarterSourceJava --continue
13+
TERM=dumb ../gradlew check compileStarterSourceJava --continue
1414
popd
1515

‎gradle/wrapper/gradle-wrapper.jar‎

53.5 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Tue May 23 10:48:11 BST 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip

‎gradlew‎

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎gradlew.bat‎

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)