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

Create latest and greatest CI job #494

Closed
TWiStErRob opened this issue May 29, 2023 · 0 comments · Fixed by #496
Closed

Create latest and greatest CI job #494

TWiStErRob opened this issue May 29, 2023 · 0 comments · Fixed by #496
Labels
a:feature new feature, improvement or request in:build build.gradle, CI on GitHub Actions on:gradle issue related to Gradle
Milestone

Comments

@TWiStErRob
Copy link
Owner

TWiStErRob commented May 29, 2023

Subject: [PATCH] Kotlin 1.8 compatiblity
---
Index: plugin/base/src/testFixtures/kotlin/net/twisterrob/gradle/test/GradleBuildTestResources.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/plugin/base/src/testFixtures/kotlin/net/twisterrob/gradle/test/GradleBuildTestResources.kt b/plugin/base/src/testFixtures/kotlin/net/twisterrob/gradle/test/GradleBuildTestResources.kt
--- a/plugin/base/src/testFixtures/kotlin/net/twisterrob/gradle/test/GradleBuildTestResources.kt	(revision 4698164919827f9ee6c9c53b4d72ecb0b44ce0a9)
+++ b/plugin/base/src/testFixtures/kotlin/net/twisterrob/gradle/test/GradleBuildTestResources.kt	(date 1685354015352)
@@ -8,16 +8,20 @@
 	val android: AndroidProject = object : AndroidProject {}
 
 	fun GradleRunnerRule.basedOn(project: KotlinProject) {
+		file(project.build, ContentMergeMode.MERGE_GRADLE, "build.gradle")
 		file(project.settings, ContentMergeMode.MERGE_GRADLE, "settings.gradle.kts")
 	}
 
 	fun GradleRunnerRule.basedOn(project: AndroidProject) {
 		file(project.build, ContentMergeMode.MERGE_GRADLE, "build.gradle")
-		file(project.settings, "settings.gradle.kts")
+		file(project.settings, ContentMergeMode.MERGE_GRADLE, "settings.gradle.kts")
 		file(project.manifest, "src", "main", "AndroidManifest.xml")
 	}
 
 	interface KotlinProject {
+		val build: String
+			get() = read("kotlin-plugin_app/build.gradle")
+
 		val settings: String
 			get() = read("kotlin-plugin_app/settings.gradle.kts")
 	}
Index: plugin/base/src/testFixtures/resources/net/twisterrob/gradle/test/kotlin-plugin_app/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/plugin/base/src/testFixtures/resources/net/twisterrob/gradle/test/kotlin-plugin_app/build.gradle b/plugin/base/src/testFixtures/resources/net/twisterrob/gradle/test/kotlin-plugin_app/build.gradle
new file mode 100644
--- /dev/null	(date 1685383075223)
+++ b/plugin/base/src/testFixtures/resources/net/twisterrob/gradle/test/kotlin-plugin_app/build.gradle	(date 1685383075223)
@@ -0,0 +1,24 @@
+if ("@net.twisterrob.test.kotlin.pluginVersion@" >= "1.8.20") {
+	// https://youtrack.jetbrains.com/issue/KT-54993
+	// Note: Gradle toolchain support was added in Gradle 6.7 and KGP 1.5.30.
+	// https://docs.gradle.org/6.7/release-notes.html#toolchain-support-for-jvm-projects
+	// https://kotlinlang.org/docs/whatsnew1530.html#support-for-java-toolchains
+	
+	java {
+		toolchain {
+			languageVersion.set(JavaLanguageVersion.of(11))
+		}
+	}
+	def agp = "@net.twisterrob.test.android.pluginVersion@"
+	if (agp < "8.1.0" || ("8.1.0" < agp && agp < "8.1.0-alpha09")) {
+		// Lexicographic version of equivalent semantic comparison: agp < 8.1.0-alpha09.
+		project.plugins.withType(com.android.build.gradle.internal.plugins.BasePlugin).configureEach {
+			android {
+				compileOptions {
+					sourceCompatibility = 11
+					targetCompatibility = 11
+				}
+			}
+		}
+	}
+}
Index: plugin/base/src/testFixtures/resources/net/twisterrob/gradle/test/kotlin-plugin_app/settings.gradle.kts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/plugin/base/src/testFixtures/resources/net/twisterrob/gradle/test/kotlin-plugin_app/settings.gradle.kts b/plugin/base/src/testFixtures/resources/net/twisterrob/gradle/test/kotlin-plugin_app/settings.gradle.kts
--- a/plugin/base/src/testFixtures/resources/net/twisterrob/gradle/test/kotlin-plugin_app/settings.gradle.kts	(revision 325289ffb30684ba29013dc17e95f76ce62710fe)
+++ b/plugin/base/src/testFixtures/resources/net/twisterrob/gradle/test/kotlin-plugin_app/settings.gradle.kts	(date 1685383075218)
@@ -1,3 +1,18 @@
+import org.gradle.util.GradleVersion
+
+buildscript {
+	repositories {
+		gradlePluginPortal()
+	}
+	dependencies {
+		classpath("org.gradle.toolchains:foojay-resolver:0.5.0")
+	}
+}
+
+if (GradleVersion.version("7.6") <= GradleVersion.current().baseVersion) {
+	apply(plugin = "org.gradle.toolchains.foojay-resolver-convention")
+}
+
 val gradleVersion = gradle.gradleVersion
 @Suppress("UNCHECKED_CAST")
 val doNotNagAbout = settings.extra["doNotNagAbout"] as (String, String, String) -> Unit
@TWiStErRob TWiStErRob added a:feature new feature, improvement or request in:build build.gradle, CI on GitHub Actions on:gradle issue related to Gradle labels May 29, 2023
@TWiStErRob TWiStErRob added this to the v0.16 milestone May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature new feature, improvement or request in:build build.gradle, CI on GitHub Actions on:gradle issue related to Gradle
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant