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 to Gradle 7.4 #196

Merged
merged 2 commits into from
Feb 14, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ configure<DoctorExtension> {
downloadSpeedWarningThreshold.set(2.0f)
daggerThreshold.set(100)
javaHome {
ensureJavaHomeMatches.set(!providers.environmentVariable("CI").forUseAtConfigurationTime().isPresent)
ensureJavaHomeMatches.set(!providers.environmentVariable("CI").isPresent)
}
}

Expand All @@ -25,7 +25,7 @@ tasks.withType(Test::class.java).configureEach {
}

tasks.wrapper {
gradleVersion = "7.3.3"
gradleVersion = "7.4"
}

buildScan {
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* [Skip multiple daemons check on non-Unix machines, not supported yet](https://github.com/runningcode/gradle-doctor/issues/84)
* [Detect Kotlin Compiler Daemon failing to connect.](https://github.com/runningcode/gradle-doctor/issues/194)
* [Support fail threshold for high GC usage](https://github.com/runningcode/gradle-doctor/issues/183)
* [Clean check is disabled in Gradle 7.4+, fixes compatibility with project isolation](https://github.com/runningcode/gradle-doctor/issues/180)

## 0.7.3
* Fix [compatiblity with Java 8.](https://github.com/runningcode/gradle-doctor/issues/171)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class TestIntegrationTest {
.withProjectDir(testProjectRoot.root)
.withPluginClasspath()
.withArguments("clean")
.withGradleVersion("7.3.3")
.buildAndFail()

assertThat(result.output).contains(
Expand All @@ -107,6 +108,19 @@ class TestIntegrationTest {
assertThat(result.output).contains("BUILD SUCCESSFUL")
}

@Test
fun cleanDependency74Succeeds() {
projectWithCleanDependency(disallowCleanTaskDependencies = true)
val result = GradleRunner.create()
.withProjectDir(testProjectRoot.root)
.withPluginClasspath()
.withGradleVersion("7.4")
.withArguments("clean")
.build()

assertThat(result.output).contains("BUILD SUCCESSFUL")
}

fun projectWithCleanDependency(disallowCleanTaskDependencies: Boolean) {
testProjectRoot.writeBuildGradle(
"""
Expand Down
4 changes: 4 additions & 0 deletions doctor-plugin/src/main/java/com/osacky/doctor/DoctorPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ class DoctorPlugin : Plugin<Project> {
}

private fun ensureNoCleanTaskDependenciesIfNeeded(target: Project, extension: DoctorExtension, pillBoxPrinter: PillBoxPrinter) {
if (GradleVersion.current() >= GradleVersion.version("7.4")) {
// Gradle 7.4 has a fix for 2488 and 10889
return
}
target.allprojects {
// We use afterEvaluate in case other plugins configure the Delete task. We want our configuration to happen last.
afterEvaluate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import com.osacky.doctor.internal.androidHome
import org.gradle.testkit.runner.GradleRunner
import org.gradle.util.GradleVersion
import org.junit.Assume
import org.junit.Assume.assumeFalse
import org.junit.Assume.assumeTrue
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
Expand All @@ -22,9 +24,9 @@ class PluginIntegrationTest constructor(private val version: String) {
@JvmStatic
@Parameterized.Parameters(name = "{0}")
fun getParams(): List<String> {
// Keep 5.0 as minimum unsupported version and 5.1 as minimum supported version.
// Keep 6.0 as minimum unsupported version and 6.1 as minimum supported version.
// Keep this list to 5 as testing against too many versions causes OOMs.
return listOf("6.0.1", "6.1.1", "6.5.1", "7.0", "7.3.3")
return listOf("6.0.1", "6.1.1", "6.5.1", "7.0", "7.3.3", "7.4")
}
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists