Skip to content

Commit

Permalink
Repro the problem found in docker-infrastructure
Browse files Browse the repository at this point in the history
After bumping to gradle-release:0.8.0, docker-infrastructure [fails publishing].
The `PublishTest` cannot reproduce it with `withPluginClasspath`, it hides the problem.
But then, the test project has to specify `gradle-release` version (0.9.0 here),
or otherwise it cannot resolve the unnamed version we're currently testing/building.

So this test can repro, but cannot be used to confirm fixes.

The failure in CI and in `PublishTest` looks like this:
```
* What went wrong:
org/jetbrains/kotlin/gradle/dsl/KotlinSingleTargetExtension
> org.jetbrains.kotlin.gradle.dsl.KotlinSingleTargetExtension
```

PS. When minimizing the repro in `Fixtures`, I accidentally discovered
that the order of Gradle plugins matters. The problem goes away when `gradle-release` goes first.
The buildscript/plugin classpath is a fascinating mess.

[fails publishing]: https://github.com/atlassian/docker-infrastructure/actions/runs/9481104563/job/26126902514
  • Loading branch information
dagguh committed Jun 12, 2024
1 parent d19e362 commit 806c334
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat

plugins {
`java-gradle-plugin`
`kotlin-dsl`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.atlassian.performance.tools.license

import org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode.SET_UPSTREAM
import org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode.TRACK
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.lib.ConfigConstants
import org.eclipse.jgit.lib.ConfigConstants.CONFIG_BRANCH_SECTION
import org.eclipse.jgit.transport.URIish
import org.junit.rules.TemporaryFolder
Expand Down Expand Up @@ -37,8 +34,8 @@ class Fixtures {
buildFolder.newFile("build.gradle").writeText(
"""
plugins {
id 'com.atlassian.performance.tools.gradle-release'
id "org.jetbrains.kotlin.jvm" version "1.3.20"
id 'com.atlassian.performance.tools.gradle-release' version "0.9.0"
}
dependencies {
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: '1.3.20'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class PublishTest {
val publishResult = GradleRunner.create()
.withProjectDir(project.root)
.withArguments("publishToMavenLocal", "--stacktrace")
.withPluginClasspath()
.forwardOutput()
.withDebug(true)
.build()
Expand Down

0 comments on commit 806c334

Please sign in to comment.