Skip to content

Commit

Permalink
Downgrade Gradle to avoid using API incompatible with older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
koperagen committed Oct 10, 2024
1 parent 0e3fdcd commit 0bb5130
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ tasks.withType<Jar> {
}

// modify all publishing tasks to depend on `changeJarTask` so the sources are swapped out with generated sources
tasks.named { it.startsWith("publish") }.configureEach {
dependsOn(processKDocsMain, changeJarTask)
tasks.configureEach {
if (name.startsWith("publish")) {
dependsOn(processKDocsMain, changeJarTask)
}
}

// Exclude the generated/processed sources from the IDE
Expand Down
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-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ConvenienceSchemaGeneratorPlugin : Plugin<Project> {
val cfgsToAdd = configs.toMutableSet()

configs.forEach { cfg ->
target.configurations.named { it == cfg }.configureEach {
target.configurations.findByName(cfg)?.apply {
cfgsToAdd.remove(cfg)
dependencies.add(
target.dependencies.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ fun runGradleBuild(
fun gradleRunner(buildDir: File, task: String): GradleRunner =
GradleRunner.create()
.withProjectDir(buildDir)
// if we use api from the newest Gradle release, a user project will fail with NoSuchMethod
// testing compatibility with an older Gradle version ensures our plugin can run on as many versions as possible
.withGradleVersion("8.5")
.withPluginClasspath()
.withArguments(task, "--stacktrace", "--info")
.withDebug(true)
Expand Down

0 comments on commit 0bb5130

Please sign in to comment.