Skip to content

Commit

Permalink
Bump minimal support PIT version to 1.4.0
Browse files Browse the repository at this point in the history
Due to integration test failures with recent Java 8 versions:
#223 (review)
  • Loading branch information
szpak committed Aug 2, 2020
1 parent d04eeb9 commit 1d78bcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.5.2 - Unreleased

- Add functional test with Spock 2 (using JUnit Platform)
- Bump minimal supported PIT version to 1.4.0 - the first version which required Java 8 (May 2018)

## 1.5.1 - 2020-05-06

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import org.gradle.internal.jvm.Jvm
@CompileDynamic
class PitestPluginPitVersionFunctionalSpec extends AbstractPitestFunctionalSpec {

private static final String PIT_1_3_VERSION = "1.3.1"
private static final String MINIMAL_JAVA9_COMPATIBLE_PIT_VERSION = "1.2.3" //https://github.com/hcoles/pitest/issues/380
private static final String MINIMAL_JAVA10_COMPATIBLE_PIT_VERSION = "1.4.0"
private static final String MINIMAL_SUPPORTED_PIT_VERSION = "1.4.0" //minimal PIT version that required Java 8 - May 2018
private static final String MINIMAL_JAVA11_COMPATIBLE_PIT_VERSION = "1.4.2" //in fact 1.4.1, but 1.4.2 is also Java 12 compatible
private static final String MINIMAL_JAVA13_COMPATIBLE_PIT_VERSION = "1.4.6" //not officially, but at least simple case works
private static final String MINIMAL_JAVA14_COMPATIBLE_PIT_VERSION = "1.4.11" //not officially, but with ASM 7.3.1
Expand Down Expand Up @@ -41,25 +39,21 @@ class PitestPluginPitVersionFunctionalSpec extends AbstractPitestFunctionalSpec
pitVersion << getPitVersionsCompatibleWithCurrentJavaVersion().unique() //be aware that unique() is available since Groovy 2.4.0
}

@SuppressWarnings("IfStatementCouldBeTernary")
private List<String> getPitVersionsCompatibleWithCurrentJavaVersion() {
return [getMinimalPitVersionCompatibleWithCurrentJavaVersion(), PitestPlugin.DEFAULT_PITEST_VERSION]
}

@SuppressWarnings("IfStatementCouldBeTernary")
private String getMinimalPitVersionCompatibleWithCurrentJavaVersion() {
if (isJava14Compatible()) {
return [PitestPlugin.DEFAULT_PITEST_VERSION, MINIMAL_JAVA14_COMPATIBLE_PIT_VERSION]
return [MINIMAL_JAVA14_COMPATIBLE_PIT_VERSION]
}
if (isJava13Compatible()) {
return [PitestPlugin.DEFAULT_PITEST_VERSION, MINIMAL_JAVA13_COMPATIBLE_PIT_VERSION]
return [MINIMAL_JAVA13_COMPATIBLE_PIT_VERSION]
}

if (Jvm.current().javaVersion.isJava11Compatible()) {
return [PitestPlugin.DEFAULT_PITEST_VERSION, MINIMAL_JAVA11_COMPATIBLE_PIT_VERSION]
}
if (Jvm.current().javaVersion.isJava10Compatible()) {
return [PitestPlugin.DEFAULT_PITEST_VERSION, MINIMAL_JAVA10_COMPATIBLE_PIT_VERSION]
return [MINIMAL_JAVA11_COMPATIBLE_PIT_VERSION]
}
if (Jvm.current().javaVersion.isJava9Compatible()) {
return [PitestPlugin.DEFAULT_PITEST_VERSION, MINIMAL_JAVA9_COMPATIBLE_PIT_VERSION, PIT_1_3_VERSION]
}
return [PitestPlugin.DEFAULT_PITEST_VERSION, "1.1.5", "1.2.0", PIT_1_3_VERSION, "1.4.0"]
return [MINIMAL_SUPPORTED_PIT_VERSION]
}

}

0 comments on commit 1d78bcd

Please sign in to comment.