Skip to content

Commit

Permalink
Update to Java 8
Browse files Browse the repository at this point in the history
This also removes all unnecessary configuration for Java 6 as well as
references to the release/2.x branch.
  • Loading branch information
TimvdLippe committed Apr 15, 2019
1 parent 881e09e commit f3edebd
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 56 deletions.
3 changes: 1 addition & 2 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ update_configs:
directory: "/"
update_schedule: "daily"
# Redundant - default repository branch by default
target_branch: "release/2.x"

target_branch: "release/3.x"
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Contributing to Mockito

Which branch :
* On mockito 2.x, make your pull request target `release/2.x`
* On mockito 3.x (or 2.x), make your pull request target `release/3.x` (or `release/2.x`)
* On next mockito version make your pull request target `master`

## Pull request criteria
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> There may be a thorough review, with feedback -> code change loop.
>
> Which branch :
> - On mockito 2.x, make your pull request target `release/2.x`
> - On mockito 3.x (or 2.x), make your pull request target `release/3.x` (or `release/2.x`)
> - On next mockito version make your pull request target `master`
>
> _This block can be removed_
Expand All @@ -15,7 +15,7 @@

check list

- [ ] Read the [contributing guide](https://github.com/mockito/mockito/blob/release/2.x/.github/CONTRIBUTING.md)
- [ ] Read the [contributing guide](https://github.com/mockito/mockito/blob/release/3.x/.github/CONTRIBUTING.md)
- [ ] PR should be motivated, i.e. what does it fix, why, and if relevant how
- [ ] If possible / relevant include an example in the description, that could help all readers
including project members to get a better picture of the change
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ script:
# We are using && below on purpose
# ciPerformRelease must run only when the entire build has completed
# This guarantees that no release steps are executed when the build or tests fail
- ./gradlew build idea -s -PcheckJavaCompatibility && ./gradlew ciPerformRelease
- ./gradlew build idea -s && ./gradlew ciPerformRelease

after_success:
#Generates coverage report:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

Most popular mocking framework for Java

[![Build Status](https://travis-ci.org/mockito/mockito.svg?branch=release/2.x)](https://travis-ci.org/mockito/mockito) [![Coverage Status](https://img.shields.io/codecov/c/github/mockito/mockito.svg)](https://codecov.io/github/mockito/mockito) [![MIT License](http://img.shields.io/badge/license-MIT-green.svg) ](https://github.com/mockito/mockito/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/mockito/mockito.svg?branch=release/3.x)](https://travis-ci.org/mockito/mockito) [![Coverage Status](https://img.shields.io/codecov/c/github/mockito/mockito.svg)](https://codecov.io/github/mockito/mockito) [![MIT License](http://img.shields.io/badge/license-MIT-green.svg) ](https://github.com/mockito/mockito/blob/master/LICENSE)

[![latest release](https://img.shields.io/badge/release%20notes-2.x-yellow.svg)](https://github.com/mockito/mockito/blob/release/2.x/doc/release-notes/official.md)
[![latest release](https://img.shields.io/badge/release%20notes-3.x-yellow.svg)](https://github.com/mockito/mockito/blob/release/3.x/doc/release-notes/official.md)
[![Bintray](https://api.bintray.com/packages/mockito/maven/mockito-development/images/download.svg)](https://bintray.com/mockito/maven)
[![Maven Central](https://img.shields.io/maven-central/v/org.mockito/mockito-core.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.mockito%22%20AND%20a%3A%22mockito-core%22)
[![Javadocs](http://www.javadoc.io/badge/org.mockito/mockito-core.svg?color=red)](http://www.javadoc.io/doc/org.mockito/mockito-core)


## Current version is 2.x
## Current version is 3.x
Still on Mockito 1.x? See [what's new](https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2) in Mockito 2!

Mockito [continuously delivers](https://github.com/mockito/mockito/wiki/Continuous-Delivery-Overview) improvements using Shipkit library (http://shipkit.org). See the [latest release notes](https://github.com/mockito/mockito/blob/release/2.x/doc/release-notes/official.md) and [latest documentation](http://javadoc.io/page/org.mockito/mockito-core/2/org/mockito/Mockito.html). Docs in javadoc.io are available 24h after release. Read also about [semantic versioning in Mockito](https://github.com/mockito/mockito/wiki/Semantic-Versioning).
Mockito [continuously delivers](https://github.com/mockito/mockito/wiki/Continuous-Delivery-Overview) improvements using Shipkit library (http://shipkit.org). See the [latest release notes](https://github.com/mockito/mockito/blob/release/3.x/doc/release-notes/official.md) and [latest documentation](http://javadoc.io/page/org.mockito/mockito-core/2/org/mockito/Mockito.html). Docs in javadoc.io are available 24h after release. Read also about [semantic versioning in Mockito](https://github.com/mockito/mockito/wiki/Semantic-Versioning).

Older 1.x releases are available in
[Central Repository](http://search.maven.org/#artifactdetails|org.mockito|mockito-core|1.10.19|jar)
Expand All @@ -28,7 +28,7 @@ and [javadoc.io](http://javadoc.io/page/org.mockito/mockito-core/1.10.19/org/moc

All you want to know about Mockito is hosted at [The Mockito Site](http://site.mockito.org) which is [Open Source](https://github.com/mockito/mockito.github.io) and likes [pull requests](https://github.com/mockito/mockito.github.io/pulls), too.

Want to contribute? Take a look at the [Contributing Guide](https://github.com/mockito/mockito/blob/release/2.x/.github/CONTRIBUTING.md).
Want to contribute? Take a look at the [Contributing Guide](https://github.com/mockito/mockito/blob/release/3.x/.github/CONTRIBUTING.md).

Enjoy Mockito!

Expand Down
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ buildscript {

dependencies {
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0'
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.0' //for 'java-compatibility-check.gradle'
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.6'

//Using buildscript.classpath so that we can resolve shipkit from maven local, during local testing
Expand Down Expand Up @@ -35,7 +34,6 @@ allprojects {

apply from: 'gradle/root/ide.gradle'
apply from: 'gradle/root/gradle-fix.gradle'
apply from: 'gradle/root/java-compatibility-check.gradle'
apply from: 'gradle/java-library.gradle'
apply from: 'gradle/license.gradle'
apply from: 'gradle/root/coverage.gradle'
Expand Down Expand Up @@ -93,8 +91,8 @@ dependencies {
}

wrapper {
gradleVersion = '4.9'
distributionSha256Sum = 'e66e69dce8173dd2004b39ba93586a184628bc6c28461bc771d6835f7f9b0d28'
gradleVersion = '5.3.1'
distributionSha256Sum = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
}

//Posting Build scans to https://scans.gradle.com
Expand Down
4 changes: 2 additions & 2 deletions gradle/java-library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ generatePomFileForJavaLibraryPublication.doLast {

bintrayUpload.enabled = true

sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 1.8
targetCompatibility = 1.8

test {
include "**/*Test.class"
Expand Down
16 changes: 7 additions & 9 deletions gradle/mockito-core/javadoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,15 @@ javadoc {
<script type="text/javascript" src="{@docRoot}/js/index.js" async defer></script>
""".replaceAll(/\r|\n|[ ]{8}/, ""))
options.stylesheetFile rootProject.file("src/javadoc/stylesheet.css")
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('Xdoclint:none', '-quiet')

def minorVersion = System.getProperty("java.version") =~ /1.8.0_(\d*)/
def minorVersion = System.getProperty("java.version") =~ /1.8.0_(\d*)/

// Since JDK 8 version 121 scripts are not allowed in comments. However,
// earlier version throw an error if an unknown option is passed.
// Therefore only add this option if the JDK is actually correct.
if (minorVersion.size() > 0 && Integer.valueOf(minorVersion[0][1]) >= 121 || JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('-allow-script-in-comments', true)
}
// Since JDK 8 version 121 scripts are not allowed in comments. However,
// earlier version throw an error if an unknown option is passed.
// Therefore only add this option if the JDK is actually correct.
if (minorVersion.size() > 0 && Integer.valueOf(minorVersion[0][1]) >= 121 || JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('-allow-script-in-comments', true)
}

doLast {
Expand Down
13 changes: 0 additions & 13 deletions gradle/root/java-compatibility-check.gradle

This file was deleted.

1 change: 0 additions & 1 deletion gradle/shipkit.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ shipkit {
'docs': 'Documentation'
]

//git.releasableBranchRegex = "master|release/.+" // matches 'master', 'release/2.x', 'release/3.x', etc.
git.releasableBranchRegex = "release/.+" // 'release/2.x', 'release/3.x', etc.

def buildNo = System.getenv("TRAVIS_BUILD_NUMBER")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apply from: "$rootDir/gradle/dependencies.gradle"
apply plugin: 'java'
description = "End-to-end tests for deprecated Mockito plugins."

sourceCompatibility = 1.8

dependencies {
testCompile project(":")
testCompile libraries.junit4
Expand Down
3 changes: 0 additions & 3 deletions subprojects/errorprone/errorprone.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ dependencies {
testCompile libraries.errorproneTestApi
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

test {
inputs.files(configurations.errorproneJavac).withNormalizer(ClasspathNormalizer)
jvmArgs += "-Xbootclasspath/p:${configurations.errorproneJavac.asPath}"
Expand Down
2 changes: 0 additions & 2 deletions subprojects/extTest/extTest.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apply from: "$rootDir/gradle/dependencies.gradle"
apply plugin: 'java'
description = "End-to-end tests for Mockito and its extensions."

sourceCompatibility = 1.8

repositories {
mavenLocal() //we depend on locally published mockito
}
Expand Down
3 changes: 0 additions & 3 deletions subprojects/junit-jupiter/junit-jupiter.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ description = "Mockito JUnit 5 support"

apply from: "$rootDir/gradle/java-library.gradle"

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
compile project.rootProject
implementation libraries.junitJupiterApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apply from: "$rootDir/gradle/dependencies.gradle"
apply plugin: 'java'
description = "End-to-end tests for automatic registration of MockitoExtension."

sourceCompatibility = 1.8

dependencies {
testCompile project(":junit-jupiter")
testCompile libraries.assertj
Expand Down
5 changes: 1 addition & 4 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#Currently building Mockito version
version=2.27.1
version=3.0.0

#Previous version used to generate release notes delta
previousVersion=2.27.0

#Not published currently, see https://github.com/mockito/mockito/issues/962
mockito.testng.version=1.0

0 comments on commit f3edebd

Please sign in to comment.