Skip to content

Commit b3c98eb

Browse files
committed
Remove support for Java 8, update dependencies, improve CI & ReadMe
* Java 8: The TravisCI build is failing due to trying to run the build in MacOS with Java 8 (not supported) * Dependencies: Updated the Junit to 5.3.2 and Gradle to 5.1.1 * CI: Modify the Bitbucket Pipeline in order to use Java 11 and split the `build` task into the `assemble` and `check` ones in order to be able to isolate which one could be failing * ReadMe: Add how to update dependencies section in order to make it easier for the end users in case of not having this repository updated to the latest versions
1 parent 720a45f commit b3c98eb

File tree

8 files changed

+28
-22
lines changed

8 files changed

+28
-22
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: java
22

33
jdk:
4-
- openjdk8
54
- openjdk11
65
- oraclejdk11
76

@@ -32,4 +31,4 @@ install: true
3231
# Compile before running the tests in order to easily check which task could be failing.
3332
script:
3433
- ./gradlew assemble --warning-mode all
35-
- ./gradlew check --warning-mode all
34+
- ./gradlew check --warning-mode all

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22

33
## Introduction
44

5-
This is a repository intended to serve as a starting point if you want to bootstrap a project in Java 8 with JUnit 5.2 and Gradle 4.6.
5+
This is a repository intended to serve as a starting point if you want to bootstrap a project in Java with JUnit and Gradle
66

77
## How To Start
88

9-
1. Install Java 8
10-
2. Clone this repository `git clone https://github.com/CodelyTV/java-bootstrap`.
11-
3. Run the tests with `./gradlew test`
9+
1. Install Java: `brew cask install java`
10+
2. Clone this repository: `git clone https://github.com/CodelyTV/java-bootstrap`.
11+
3. Execute some [Gradle lifecycle tasks](https://docs.gradle.org/current/userguide/java_plugin.html#lifecycle_tasks) in order to check everything is OK:
12+
1. Create [the project JAR](https://docs.gradle.org/current/userguide/java_plugin.html#sec:jar) and other project artifacts:
13+
`./gradlew assemble --warning-mode all`
14+
2. Run the tests and plugins verification tasks:
15+
`./gradlew check --warning-mode all`
1216
4. Start developing!
17+
18+
## How to update dependencies
19+
20+
* Gradle (current version: 5.1.1 - [releases](https://gradle.org/releases/)):
21+
`./gradlew wrapper --gradle-version=5.1.1 --distribution-type=bin` or modifying the [gradle-wrapper.properties](gradle/wrapper/gradle-wrapper.properties#L3)
22+
* JUnit (current version: 5.3.2 - [releases](https://junit.org/junit5/docs/snapshot/release-notes/index.html)):
23+
[`build.gradle:11`](build.gradle#L11-L12)

bitbucket-pipelines.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: java:8
1+
image: java:11
22

33
options:
44
max-time: 10
@@ -9,4 +9,5 @@ pipelines:
99
caches:
1010
- gradle
1111
script:
12-
- bash ./gradlew build
12+
- bash ./gradlew assemble --warning-mode all
13+
- bash ./gradlew check --warning-mode all

build.gradle

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
apply plugin: 'java'
22

3-
sourceCompatibility = 1.8
3+
sourceCompatibility = 1.11
4+
targetCompatibility = 1.11
45

56
repositories {
67
mavenCentral()
78
}
89

910
dependencies {
10-
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0')
11-
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0')
11+
testCompile('org.junit.jupiter:junit-jupiter-api:5.3.2')
12+
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.3.2')
1213
}
1314

1415
test {
@@ -21,9 +22,4 @@ test {
2122
reports {
2223
html.enabled = true
2324
}
24-
}
25-
26-
task wrapper(type: Wrapper) {
27-
description = 'Generates gradlew[.bat] scripts'
28-
gradleVersion = '4.6'
2925
}

gradle/wrapper/gradle-wrapper.jar

861 Bytes
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 01 07:06:45 CEST 2018
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip

gradlew

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ APP_NAME="Gradle"
2828
APP_BASE_NAME=`basename "$0"`
2929

3030
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
31+
DEFAULT_JVM_OPTS='"-Xmx64m"'
3232

3333
# Use the maximum available, or set MAX_FD != -1 to use that value.
3434
MAX_FD="maximum"
@@ -169,4 +169,4 @@ if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169169
cd "$(dirname "$0")"
170170
fi
171171

172-
exec "$JAVACMD" "$@"
172+
exec "$JAVACMD" "$@"

gradlew.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
1414
set APP_HOME=%DIRNAME%
1515

1616
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
17+
set DEFAULT_JVM_OPTS="-Xmx64m"
1818

1919
@rem Find java.exe
2020
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -81,4 +81,4 @@ exit /b 1
8181
:mainEnd
8282
if "%OS%"=="Windows_NT" endlocal
8383

84-
:omega
84+
:omega

0 commit comments

Comments
 (0)