-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue #5 caused by incompatible Gradle API
- Loading branch information
1 parent
c9ff9b3
commit 8a01b57
Showing
9 changed files
with
189 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ jobs: | |
java-version: '8' | ||
|
||
- name: build | ||
run: ./gradlew build -S --no-daemon | ||
run: ./gradlew check -S --no-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-6.7-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
155 changes: 155 additions & 0 deletions
155
src/functionalTest/kotlin/io/johnsonlee/gradle/publish/KotlinLibraryFunctionalTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
package io.johnsonlee.gradle.publish | ||
|
||
import com.didiglobal.booster.kotlinx.file | ||
import com.didiglobal.booster.kotlinx.touch | ||
import org.gradle.testkit.runner.BuildResult | ||
import org.gradle.testkit.runner.GradleRunner | ||
import org.gradle.testkit.runner.TaskOutcome | ||
import java.io.File | ||
import kotlin.test.Test | ||
import kotlin.test.assertTrue | ||
|
||
class KotlinLibraryFunctionalTest { | ||
|
||
private val tmp = File("build", "tmp").also(File::mkdirs) | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_2`() { | ||
val result = publishToMavenLocal("6.2") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_2_1`() { | ||
val result = publishToMavenLocal("6.2.1") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_2_2`() { | ||
val result = publishToMavenLocal("6.2.2") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_3`() { | ||
val result = publishToMavenLocal("6.3") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_4`() { | ||
val result = publishToMavenLocal("6.4") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_4_1`() { | ||
val result = publishToMavenLocal("6.4.1") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_5`() { | ||
val result = publishToMavenLocal("6.5") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_5_1`() { | ||
val result = publishToMavenLocal("6.5.1") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_6`() { | ||
val result = publishToMavenLocal("6.6") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_6_1`() { | ||
val result = publishToMavenLocal("6.6.1") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_7`() { | ||
val result = publishToMavenLocal("6.7") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_7_1`() { | ||
val result = publishToMavenLocal("6.7.1") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_8`() { | ||
val result = publishToMavenLocal("6.8") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_8_1`() { | ||
val result = publishToMavenLocal("6.8.1") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_8_2`() { | ||
val result = publishToMavenLocal("6.8.2") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_8_3`() { | ||
val result = publishToMavenLocal("6.8.3") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
|
||
@Test | ||
fun `publish kotlin library to maven local with gradle 6_9`() { | ||
val result = publishToMavenLocal("6.9") | ||
assertTrue(result.tasks.none { it.outcome == TaskOutcome.FAILED }) | ||
} | ||
private fun publishToMavenLocal(gradleVersion: String): BuildResult { | ||
val projectDir = createTempDir(directory = tmp).apply { | ||
file("settings.gradle.kts").writeText("") | ||
file("build.gradle.kts").writeText(""" | ||
plugins { | ||
kotlin("jvm") version embeddedKotlinVersion | ||
id("io.johnsonlee.sonatype-publish-plugin") | ||
} | ||
repositories { | ||
mavenCentral() | ||
google() | ||
} | ||
group = "io.johnsonlee.functional-test" | ||
version = "1.0.0" | ||
""".trimIndent()) | ||
file("src", "main", "kotlin", "Library.kt").touch().writeText(""" | ||
object Library { | ||
fun init() { | ||
} | ||
} | ||
""".trimIndent()) | ||
} | ||
|
||
try { | ||
return GradleRunner.create().apply { | ||
forwardOutput() | ||
withGradleVersion(gradleVersion) | ||
withPluginClasspath() | ||
withArguments("publishToMavenLocal", "-S") | ||
withProjectDir(projectDir) | ||
}.build() | ||
} finally { | ||
projectDir.deleteRecursively() | ||
} | ||
} | ||
|
||
} |
38 changes: 0 additions & 38 deletions
38
src/functionalTest/kotlin/io/johnsonlee/gradle/publish/NexusPublishPluginFunctionalTest.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package io.johnsonlee.gradle.publish | ||
|
||
import org.gradle.util.GradleVersion | ||
|
||
internal val GRADLE_6_6 = GradleVersion.version("6.6") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters