Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update minimum support Java version from 8 to 11 #2804

Merged
merged 2 commits into from
Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# Definition of the build matrix
strategy:
matrix:
java: [8, 11, 17]
java: [11, 17]
mock-maker: ['mock-maker-default', 'mock-maker-inline', 'mock-maker-subclass']

# All build steps
Expand All @@ -48,11 +48,11 @@ jobs:
java-version: ${{ matrix.java }}

- name: 3. Validate Gradle wrapper
if: matrix.java == 8 && matrix.mock-maker == 'mock-maker-default' # SINGLE-MATRIX-JOB
if: matrix.java == 11 && matrix.mock-maker == 'mock-maker-default' # SINGLE-MATRIX-JOB
uses: gradle/wrapper-validation-action@v1.0.5 # https://github.com/gradle/wrapper-validation-action

- name: 4. Build and check reproducibility of artifacts (single job only)
if: matrix.java == 8 && matrix.mock-maker == 'mock-maker-default' # SINGLE-MATRIX-JOB
if: matrix.java == 11 && matrix.mock-maker == 'mock-maker-default' # SINGLE-MATRIX-JOB
run: ./check_reproducibility.sh

- name: 5. Spotless check (single job only). Run './gradlew spotlessApply' locally if this job fails.
Expand Down
19 changes: 13 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
id 'eclipse'
id 'com.github.ben-manes.versions' version '0.44.0'
id 'biz.aQute.bnd.builder' version '6.4.0'
id 'ru.vyarus.animalsniffer' version '1.5.2'
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
id 'ru.vyarus.animalsniffer' version '1.6.0'
}

description = 'Mockito mock objects library core API and implementation'
Expand Down Expand Up @@ -52,10 +52,8 @@ allprojects { proj ->
mavenCentral()
google()
}
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
plugins.withId('java') {
proj.apply from: "$rootDir/gradle/errorprone.gradle"
}
plugins.withId('java') {
proj.apply from: "$rootDir/gradle/errorprone.gradle"
}
tasks.withType(JavaCompile) {
//I don't believe those warnings add value given modern IDEs
Expand All @@ -66,7 +64,7 @@ allprojects { proj ->
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
options.setSource('8')
options.setSource('11')
}

tasks.withType(AbstractArchiveTask) {
Expand Down Expand Up @@ -107,6 +105,15 @@ dependencies {
animalsniffer {
sourceSets = [sourceSets.main]
annotation = 'org.mockito.internal.SuppressSignatureCheck'
// See please https://github.com/mojohaus/animal-sniffer/issues/172
ignore += [
'java.lang.instrument.Instrumentation',
'java.lang.invoke.MethodHandle',
'java.lang.invoke.MethodHandles$Lookup',
'java.lang.StackWalker',
'java.lang.StackWalker$StackFrame',
'java.lang.StackWalker$Option'
]
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ org.gradle.caching=true
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 \
-XX:+IgnoreUnrecognizedVMOptions \
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
Expand Down
6 changes: 0 additions & 6 deletions gradle/errorprone.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@

apply plugin: "net.ltgt.errorprone"

if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
dependencies {
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
}
}

dependencies {
errorprone libraries.errorprone
}
4 changes: 2 additions & 2 deletions gradle/java-library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ generatePomFileForJavaLibraryPublication.doLast {
assert pom.name == archivesBaseName
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11

test {
include "**/*Test.class"
Expand Down
217 changes: 0 additions & 217 deletions gradle/mockito-core/java-8-docs/package-list

This file was deleted.