Browse Source

Tooling maintenance (#3606)

* Update Gradle to 8.3 in tooling

* Introduce version catalogs

* Update Kotlin

* Update Intellij SDK plugin

* Update download plugin

* Update shadow jar plugin

* Update Gradle plugin portal plugin
pull/3607/head
Alexey Tsvetkov 1 year ago committed by GitHub
parent
commit
02224ccd3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      gradle-plugins/build.gradle.kts
  2. 1
      gradle-plugins/buildSrc/src/main/kotlin/BuildProperties.kt
  3. 28
      gradle-plugins/compose/build.gradle.kts
  4. 2
      gradle-plugins/gradle.properties
  5. 17
      gradle-plugins/gradle/libs.versions.toml
  6. 2
      gradle-plugins/gradle/wrapper/gradle-wrapper.properties
  7. 2
      gradle-plugins/preview-rpc/build.gradle.kts
  8. 6
      idea-plugin/build.gradle.kts
  9. 9
      idea-plugin/gradle/libs.versions.toml
  10. 2
      idea-plugin/gradle/wrapper/gradle-wrapper.properties

10
gradle-plugins/build.gradle.kts

@ -2,10 +2,11 @@ import com.gradle.publish.PluginBundleExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins { plugins {
val kotlinVersion = "1.7.20" alias(libs.plugins.kotlin.jvm) apply false
kotlin("jvm") version kotlinVersion apply false alias(libs.plugins.kotlin.serialization) apply false
kotlin("plugin.serialization") version kotlinVersion apply false alias(libs.plugins.publish.plugin.portal) apply false
id("com.gradle.plugin-publish") version "0.17.0" apply false alias(libs.plugins.shadow.jar) apply false
alias(libs.plugins.download) apply false
} }
subprojects { subprojects {
@ -33,6 +34,7 @@ subprojects {
// which is bundled to the oldest supported Gradle // which is bundled to the oldest supported Gradle
kotlinOptions.languageVersion = "1.5" kotlinOptions.languageVersion = "1.5"
kotlinOptions.apiVersion = "1.5" kotlinOptions.apiVersion = "1.5"
kotlinOptions.jvmTarget = "1.8"
} }
} }

1
gradle-plugins/buildSrc/src/main/kotlin/BuildProperties.kt

@ -11,7 +11,6 @@ object BuildProperties {
const val group = "org.jetbrains.compose" const val group = "org.jetbrains.compose"
const val website = "https://www.jetbrains.com/lp/compose/" const val website = "https://www.jetbrains.com/lp/compose/"
const val vcs = "https://github.com/JetBrains/compose-jb" const val vcs = "https://github.com/JetBrains/compose-jb"
const val serializationVersion = "1.2.1"
fun composeVersion(project: Project): String = fun composeVersion(project: Project): String =
System.getenv("COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION") System.getenv("COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION")
?: project.findProperty("compose.version") as String ?: project.findProperty("compose.version") as String

28
gradle-plugins/compose/build.gradle.kts

@ -2,13 +2,13 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import de.undercouch.gradle.tasks.download.Download import de.undercouch.gradle.tasks.download.Download
plugins { plugins {
kotlin("jvm") alias(libs.plugins.kotlin.jvm)
kotlin("plugin.serialization") alias(libs.plugins.kotlin.serialization)
id("com.gradle.plugin-publish") alias(libs.plugins.publish.plugin.portal)
id("java-gradle-plugin") id("java-gradle-plugin")
id("maven-publish") id("maven-publish")
id("com.github.johnrengelman.shadow") version "7.0.0" alias(libs.plugins.shadow.jar)
id("de.undercouch.download") version "5.3.0" alias(libs.plugins.download)
} }
gradlePluginConfig { gradlePluginConfig {
@ -35,7 +35,7 @@ tasks.named("compileKotlin") {
dependsOn(buildConfig) dependsOn(buildConfig)
} }
sourceSets.main.configure { sourceSets.main.configure {
java.srcDir(buildConfigDir) java.srcDir(buildConfig.flatMap { it.generatedOutputDir })
} }
val embeddedDependencies by configurations.creating { val embeddedDependencies by configurations.creating {
@ -63,12 +63,10 @@ dependencies {
testImplementation(gradleTestKit()) testImplementation(gradleTestKit())
testImplementation(kotlin("gradle-plugin-api")) testImplementation(kotlin("gradle-plugin-api"))
// include relocated download task to avoid potential runtime conflicts embedded(libs.download.task)
embedded("de.undercouch:gradle-download-task:5.3.0") embedded(libs.serialization.json)
embedded(libs.serialization.core)
embedded("org.jetbrains.kotlinx:kotlinx-serialization-json:${BuildProperties.serializationVersion}") embedded(libs.serialization.core.jvm)
embedded("org.jetbrains.kotlinx:kotlinx-serialization-core:${BuildProperties.serializationVersion}")
embedded("org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:${BuildProperties.serializationVersion}")
embedded(project(":preview-rpc")) embedded(project(":preview-rpc"))
embedded(project(":jdk-version-probe")) embedded(project(":jdk-version-probe"))
} }
@ -77,7 +75,9 @@ val shadow = tasks.named<ShadowJar>("shadowJar") {
val fromPackage = "de.undercouch" val fromPackage = "de.undercouch"
val toPackage = "org.jetbrains.compose.$fromPackage" val toPackage = "org.jetbrains.compose.$fromPackage"
relocate(fromPackage, toPackage) relocate(fromPackage, toPackage)
archiveClassifier.set("shadow") archiveBaseName.set("shadow")
archiveClassifier.set("")
archiveVersion.set("")
configurations = listOf(embeddedDependencies) configurations = listOf(embeddedDependencies)
exclude("META-INF/gradle-plugins/de.undercouch.download.properties") exclude("META-INF/gradle-plugins/de.undercouch.download.properties")
exclude("META-INF/versions/**") exclude("META-INF/versions/**")
@ -165,7 +165,7 @@ for (gradleVersion in supportedGradleVersions) {
configureAllTests { configureAllTests {
dependsOn(":publishToMavenLocal") dependsOn(":publishToMavenLocal")
systemProperty("compose.tests.compose.gradle.plugin.version", BuildProperties.deployVersion(project)) systemProperty("compose.tests.compose.gradle.plugin.version", BuildProperties.deployVersion(project))
val summaryDir = project.buildDir.resolve("test-summary") val summaryDir = project.layout.buildDirectory.get().asFile.resolve("test-summary")
systemProperty("compose.tests.summary.file", summaryDir.resolve("$name.md").absolutePath) systemProperty("compose.tests.summary.file", summaryDir.resolve("$name.md").absolutePath)
systemProperties(project.properties.filter { it.key.startsWith("compose.") }) systemProperties(project.properties.filter { it.key.startsWith("compose.") })
} }

2
gradle-plugins/gradle.properties

@ -10,7 +10,7 @@ compose.tests.compiler.compatible.kotlin.version=1.9.0
# The latest version of Kotlin compatible with compose.tests.compiler.version for JS target. Used only on CI. # The latest version of Kotlin compatible with compose.tests.compiler.version for JS target. Used only on CI.
compose.tests.js.compiler.compatible.kotlin.version=1.9.0 compose.tests.js.compiler.compatible.kotlin.version=1.9.0
# __SUPPORTED_GRADLE_VERSIONS__ # __SUPPORTED_GRADLE_VERSIONS__
compose.tests.gradle.versions=7.3.3, 8.1 compose.tests.gradle.versions=7.3.3, 8.3
# A version of Gradle plugin, that will be published, # A version of Gradle plugin, that will be published,
# unless overridden by COMPOSE_GRADLE_PLUGIN_VERSION env var. # unless overridden by COMPOSE_GRADLE_PLUGIN_VERSION env var.

17
gradle-plugins/gradle/libs.versions.toml

@ -0,0 +1,17 @@
[versions]
kotlin = "1.9.0"
gradle-download-plugin = "5.5.0"
kotlinx-serialization = "1.2.1"
[libraries]
download-task = { module = "de.undercouch:gradle-download-task", version.ref = "gradle-download-plugin" }
serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
serialization-core-jvm = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core-jvm", version.ref = "kotlinx-serialization" }
[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
shadow-jar = "com.github.johnrengelman.shadow:8.1.1"
download = { id = "de.undercouch.download", version.ref = "gradle-download-plugin" }
publish-plugin-portal = "com.gradle.plugin-publish:1.2.1"

2
gradle-plugins/gradle/wrapper/gradle-wrapper.properties vendored

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

2
gradle-plugins/preview-rpc/build.gradle.kts

@ -1,5 +1,5 @@
plugins { plugins {
kotlin("jvm") alias(libs.plugins.kotlin.jvm)
id("maven-publish") id("maven-publish")
} }

6
idea-plugin/build.gradle.kts

@ -2,9 +2,9 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins { plugins {
id("java") id("java")
id("org.jetbrains.kotlin.jvm") version "1.5.10" alias(libs.plugins.kotlin.jvm)
id("org.jetbrains.intellij") version "1.12.0" alias(libs.plugins.intellij.sdk)
id("org.jetbrains.changelog") version "1.3.1" alias(libs.plugins.intellij.changelog)
} }
val projectProperties = ProjectProperties(project) val projectProperties = ProjectProperties(project)

9
idea-plugin/gradle/libs.versions.toml

@ -0,0 +1,9 @@
[versions]
kotlin = "1.9.0"
[libraries]
[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
intellij-sdk = "org.jetbrains.intellij:1.15.0"
intellij-changelog = "org.jetbrains.changelog:2.2.0"

2
idea-plugin/gradle/wrapper/gradle-wrapper.properties vendored

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

Loading…
Cancel
Save