diff --git a/gradle.properties b/gradle.properties index 9e5e6ea..9a0211d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,5 +2,8 @@ org.gradle.jvmargs=-Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError org.gradle.caching=true org.gradle.parallel=true +org.gradle.configuration-cache=true +org.gradle.configuration-cache.parallel=true + dependency.analysis.autoapply=false dependency.analysis.print.build.health=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..2733ed5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/plugin-best-practices-plugin/build.gradle b/plugin-best-practices-plugin/build.gradle index 1ad8df0..25adccf 100644 --- a/plugin-best-practices-plugin/build.gradle +++ b/plugin-best-practices-plugin/build.gradle @@ -85,12 +85,16 @@ testing { } gradlePlugin { + website = 'https://github.com/autonomousapps/gradle-best-practices-plugin' + vcsUrl = 'https://github.com/autonomousapps/gradle-best-practices-plugin' + plugins { plugin { id = 'com.autonomousapps.plugin-best-practices-plugin' implementationClass = 'com.autonomousapps.GradleBestPracticesPlugin' displayName = 'Gradle Best Practices Plugin' description = 'Gradle Plugin that detects violations of Gradle best practices in Gradle Plugins' + tags = ['best practices'] } } } @@ -104,9 +108,3 @@ def check = tasks.named('check') { tasks.named('publishPlugins') { dependsOn(check) } - -pluginBundle { - website = 'https://github.com/autonomousapps/gradle-best-practices-plugin' - vcsUrl = 'https://github.com/autonomousapps/gradle-best-practices-plugin' - tags = ['best practices'] -} diff --git a/plugin-best-practices-plugin/src/main/kotlin/com/autonomousapps/GradleBestPracticesPlugin.kt b/plugin-best-practices-plugin/src/main/kotlin/com/autonomousapps/GradleBestPracticesPlugin.kt index fd30065..fc771ee 100644 --- a/plugin-best-practices-plugin/src/main/kotlin/com/autonomousapps/GradleBestPracticesPlugin.kt +++ b/plugin-best-practices-plugin/src/main/kotlin/com/autonomousapps/GradleBestPracticesPlugin.kt @@ -23,13 +23,13 @@ class GradleBestPracticesPlugin : Plugin { val baselineTask = tasks.register("bestPracticesBaseline", CreateBaselineTask::class.java) - // A RegularFileProperty is allowed to wrap a nullable RegularFile - @Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") val detectViolationsTask = tasks.register("detectViolations", DetectBestPracticesViolationsTask::class.java) { with(it) { classesDirs.setFrom(mainOutput) - baseline.set(extension.baseline.map { f -> - if (f.asFile.exists()) f else null + baseline.set(extension.baseline.flatMap { + // Weird avoidance of nullability annotation issues required til Gradle 9.0 + // https://github.com/gradle/gradle/issues/25341 + provider { if (it.asFile.exists()) it else null } }) logLevel.set(extension.level) outputJson.set(layout.buildDirectory.file("reports/best-practices/report.json")) @@ -37,14 +37,12 @@ class GradleBestPracticesPlugin : Plugin { } } - // A RegularFileProperty is allowed to wrap a nullable RegularFile - @Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") val checkBestPracticesTask = tasks.register("checkBestPractices", CheckBestPracticesTask::class.java) { t -> with(t) { reportJson.set(detectViolationsTask.flatMap { it.outputJson }) reportText.set(detectViolationsTask.flatMap { it.outputText }) - baseline.set(extension.baseline.map { f -> - if (f.asFile.exists()) f else null + baseline.set(extension.baseline.flatMap { + provider { if (it.asFile.exists()) it else null } }) logLevel.set(extension.level) projectPath.set(project.path) diff --git a/settings.gradle b/settings.gradle index 4c7376c..7aca3ca 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,7 +7,7 @@ pluginManagement { } plugins { - id 'com.gradle.enterprise' version '3.10.2' + id 'com.gradle.develocity' version '4.0' id 'com.gradle.plugin-publish' version '1.0.0' id 'com.autonomousapps.dependency-analysis' version '1.22.0' id 'com.autonomousapps.plugin-best-practices-plugin' version '0.9' @@ -16,7 +16,7 @@ pluginManagement { } plugins { - id 'com.gradle.enterprise' + id 'com.gradle.develocity' } rootProject.name = 'gradle-best-practices' @@ -30,10 +30,9 @@ dependencyResolutionManagement { } } -gradleEnterprise { +develocity { buildScan { - publishAlways() - termsOfServiceUrl = 'https://gradle.com/terms-of-service' - termsOfServiceAgree = 'yes' + termsOfUseUrl = 'https://gradle.com/terms-of-service' + termsOfUseAgree = 'yes' } }