Skip to content

Commit

Permalink
Merge branch 'main' into plugins-release
Browse files Browse the repository at this point in the history
plugins v0.9.0 release
  • Loading branch information
ShreckYe committed Dec 4, 2024
2 parents af629b6 + c3db6c5 commit 21c4b3b
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 30 deletions.
7 changes: 6 additions & 1 deletion COMMON_GRADLE_DEPENDENCIES_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# "common-gradle-dependencies" change log

## v0.9.0-20241203 / 2024-12-05

* bump the dependency versions in `CommonVersions` to the latest as of Dec 3, 2024 (including pre-release versions except for Vert.x 5)
* add a version for kotlinx-io

## v0.8.0-20241016 / 2024-10-18

* bump the dependency versions in CommonVersions to the latest compatible with Kotlin 2.0.10 as of Oct 16, 2024
* bump the dependency versions in `CommonVersions` to the latest compatible with Kotlin 2.0.10 as of Oct 16, 2024
* add some dependencies and versions of "androidx" and "org.jetbrains.androidx"
6 changes: 6 additions & 0 deletions PLUGINS_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# "Gradle plugins" change log

## v0.9.0 / 2024-12-05

There are no functional changes in this release.

* bump the dependency common-gradle-dependencies to v0.9.0-20241203

## v0.8.0 / 2024-12-03

* bump Kotlin to 2.1.0, Gradle to v8.1.11, kotlinx-benchmark to v0.4.13, and Compose Multiplatform to v1.7.1
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ There are currently no docs or tutorials on how to use the plugins. [Check out t

## Gradle version and Kotlin version

See [gradle/wrapper/gradle-wrapper.properties](gradle/wrapper/gradle-wrapper.properties) for the currently dependent Gradle version and [buildSrc/build.gradle.kts](buildSrc/build.gradle.kts) for the currently dependent Kotlin version. These versions are tested against and used by us. There might be compatibility issues when you use other versions of Gradle or Kotlin, especially versions with different [MAJOR](https://semver.org/) versions.
See [gradle/wrapper/gradle-wrapper.properties](gradle/wrapper/gradle-wrapper.properties) for the current dependency Gradle version and [buildSrc/build.gradle.kts](buildSrc/build.gradle.kts) for the current dependency Kotlin version. These versions are tested against and used by us. There might be compatibility issues when you use other versions of Gradle or Kotlin, especially versions with different [MAJOR](https://semver.org/) versions.

### About the version of the Kotlin Gradle plugins

The projects and plugins depend on a certain version of the Kotlin Gradle plugins. Sometimes it's needed to specify your own version of the Kotlin Gradle plugins when using the plugins in your project. For example, a version of [Compose Multiplatform](https://www.jetbrains.com/lp/compose-mpp/) currently supports only a certain version of the Kotlin Gradle plugins. Especially, if your desired Kotlin version is lower than this project's dependent Kotlin version, you need to exclude the transitive Kotlin dependencies.
The projects and plugins depend on a certain version of the Kotlin Gradle plugins. Sometimes it's needed to specify your own version of the Kotlin Gradle plugins when using the plugins in your project. For example, a version of [Compose Multiplatform](https://www.jetbrains.com/lp/compose-mpp/) currently supports only a certain version of the Kotlin Gradle plugins. Especially, if your desired Kotlin version is lower than this project's dependency Kotlin version, you need to exclude the transitive Kotlin dependencies.

For example, with Compose 1.3.1 in `buildSrc/build.gradle.kts`:

Expand Down Expand Up @@ -49,6 +49,12 @@ configurations.all {
}
```

## Common Gradle dependencies

The `common-gradle-dependenicies` module includes dependencies and their versions that we use in our projects.

Please note that this project often has breaking/incompatible changes, and the Gradle plugin modules depend on a certain version of `common-gradle-dependenicies` as its library dependency. If you use both the Gradle plugins and `common-gradle-dependenicies` in your project and encounter `java.lang.NoClassDefFoundError` when loading your Gradle build, please consider updating them to matching versions.

## Developer notices

1. IntelliJ IDEA doesn't work well with applying plugins to script plugins in project sources. If a script plugin's code does not resolve, try restarting IntelliJ IDEA.
Expand Down
2 changes: 1 addition & 1 deletion architecture-common-gradle-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
dependencies {
implementation(project(":kotlin-common-gradle-plugins"))
implementation("org.jetbrains.kotlin:compose-compiler-gradle-plugin:${DependencyVersions.kotlin}")
// use the version in `buildSrc` so there is no need to frequently update the dependent bootstrapping `common-gradle-dependencies` version in "buildSrc"
// use the version in `buildSrc` so there is no need to frequently update the dependency bootstrapping `common-gradle-dependencies` version in "buildSrc"
implementation("org.jetbrains.compose:compose-gradle-plugin:${DependencyVersions.composeMultiplatform}")

//api(project(":common-gradle-dependencies"))
Expand Down
3 changes: 1 addition & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ dependencies {
}
*/
// for `KotlinCompilationTask` and the version is compatible with Compose 1.6.11
// With Kotlin 2.0.20, a "Could not parse POM" build error occurs in the JVM projects of some dependent projects.
implementation(kotlin("gradle-plugin", "2.1.0"))
implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:5.1.1") // This version has to be used for Gradle 8.11.2.
implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:5.1.1") // This version has to be used for Gradle 8.11.1.

implementation("com.gradle.publish:plugin-publish-plugin:1.3.0")

Expand Down
8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/VersionsAndDependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ object DependencyVersions {
val binaryCompatibilityValidator = "0.16.3"
}

val alignedPluginVersion = "0.8.0"
val alignedPluginVersion = "0.9.0"

// "x.y.z" indicates the version of the way of organizing the code,
// and the date indicates the version when the dependency versions are updated.
val commonGradleDependenciesVersion = "0.8.0-20241201-SNAPSHOT"
val commonGradleDependenciesVersion = "0.9.0-20241203-SNAPSHOT"

// This is the source dependency version. There is another build source dependency in "buildSrc/build.gradle.kts".
val pluginProjectSourceDependentStableCommonGradleDependenciesVersion = "0.8.0-20241016".apply {
require(!endsWith("SNAPSHOT"))
val pluginProjectSourceDependencyStableCommonGradleDependenciesVersion = "0.9.0-20241203".apply {
require(!endsWith("SNAPSHOT")) // comment this out when debugging and testing snapshots
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

dependencies {
implementation("com.huanshankeji:common-gradle-dependencies:$pluginProjectSourceDependentStableCommonGradleDependenciesVersion")
implementation("com.huanshankeji:common-gradle-dependencies:$pluginProjectSourceDependencyStableCommonGradleDependenciesVersion")
}

tasks.named<KotlinCompilationTask<*>>("compileKotlin").configure {
Expand Down
5 changes: 3 additions & 2 deletions common-gradle-dependencies/api/common-gradle-dependencies.api
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ public final class com/huanshankeji/CommonGradleDependenciesDummyPluginPlugin :

public final class com/huanshankeji/CommonVersions {
public fun <init> ()V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/huanshankeji/CommonVersions$Androidx;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/huanshankeji/CommonVersions$Androidx;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/huanshankeji/CommonVersions$Androidx;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/huanshankeji/CommonVersions$Androidx;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getAndroidx ()Lcom/huanshankeji/CommonVersions$Androidx;
public final fun getArrow ()Ljava/lang/String;
public final fun getComposeMultiplatform ()Ljava/lang/String;
Expand All @@ -346,6 +346,7 @@ public final class com/huanshankeji/CommonVersions {
public final fun getKotlinxCoroutines ()Ljava/lang/String;
public final fun getKotlinxDatetime ()Ljava/lang/String;
public final fun getKotlinxHtml ()Ljava/lang/String;
public final fun getKotlinxIo ()Ljava/lang/String;
public final fun getKotlinxSerialization ()Ljava/lang/String;
public final fun getKtor ()Ljava/lang/String;
public final fun getOrgJunit ()Ljava/lang/String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class CommonDependencies(val versions: CommonVersions = CommonVersions()) {
// TODO consider refactoring other inner classes to this architecture too

class JetbrainsAndroidx(defaultVersions: CommonVersions.JetbrainsAndroidx) {
interface Subgroup : CommonDependencies.SubgroupWithNameInArtifact {
interface Subgroup : SubgroupWithNameInArtifact {
override val groupPrefix: String get() = "org.jetbrains.androidx"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
package com.huanshankeji

import GeneratedVersions

class CommonVersions(
val kotlin: String = GeneratedVersions.kotlin,

val kotlinCommon: String = "0.4.0",
val kotlinCommon: String = "0.5.1",

val kotlinxCoroutines: String = "1.9.0",
val kotlinxHtml: String = "0.11.0",
val kotlinxSerialization: String = "1.7.1", // "1.7.2" and "1.7.3" use Kotlin 2.0.20 and seem to cause problems with Kotlin 2.0.10 builds.
val kotlinxSerialization: String = "1.7.3",
val kotlinxDatetime: String = "0.6.1",
val kotlinxBenchmark: String = GeneratedVersions.kotlinxBenchmark,
// TODO `kotlinxIo`
val kotlinxIo: String = "0.6.0",
val exposed: String = "0.56.0",
val ktor: String = "2.3.12", // "3.0.0" uses Kotlin 2.0.20 too.
val ktor: String = "3.0.1",
val androidx: Androidx = Androidx(),

val vertx: String = "4.5.10",
val arrow: String = "1.2.4",
val orgJunit: String = "5.11.2", // JUnit 5 actually
val kotest: String = "5.9.1", // v6.0.0.M1 is available already
val vertx: String = "4.5.11", // "5.0.0.CR2" is available but it's used here yet. See https://vertx.io/docs/guides/vertx-5-migration-guide/.
val arrow: String = "2.0.0-rc.1",
val orgJunit: String = "5.11.3", // JUnit 5 actually
val kotest: String = "6.0.0.M1", // v6.0.0.M1 is available already
val postgreSql: String = "42.7.4",
val slf4j: String = "1.7.36", // TODO: consider replacing with kotlin-logging (https://github.com/oshai/kotlin-logging)
val testContainers: String = "1.20.2"
val testContainers: String = "1.20.4"
) {
class JetbrainsAndroidx(
val composeMultiplatform: String = GeneratedVersions.composeMultiplatform, // this is usually only used in classpath dependencies
val lifecycle: String = "2.8.3",
val lifecycle: String = "2.8.4",
val navigation: String = "2.8.0-alpha10",
)

Expand All @@ -40,9 +42,9 @@ class CommonVersions(
) {
class Compose(
val compiler: String = "1.5.15",
val common: String = "1.7.4", // for "animation", "foundation", "material","runtime", and "ui"
val material3: String = "1.3.0",
val material3Adaptive: String = "1.0.0"
val common: String = "1.7.5", // for "animation", "foundation", "material","runtime", and "ui"
val material3: String = "1.3.1",
val material3Adaptive: String = "1.0.0" // This version is not available yet. I don't remember why I added this. Maybe it's for the future.
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public final class com/huanshankeji/SourceFile {
public final class com/huanshankeji/SourceSetConfig {
public static final field Companion Lcom/huanshankeji/SourceSetConfig$Companion;
public fun <init> (Lcom/huanshankeji/SourceSetConfig$Type;Ljava/lang/String;Ljava/util/List;)V
public final fun getDependents ()Ljava/util/List;
public final fun getDependencies ()Ljava/util/List;
public final fun getName ()Ljava/lang/String;
public final fun getType ()Lcom/huanshankeji/SourceSetConfig$Type;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.huanshankeji

// TODO use or remove
// TODO How should dependents be added, the "implementation" way or "api" way? Does this make this class too complicated and unnecessary as one can just call the Gradle functions directly?
class SourceSetConfig(val type: Type, val name: String, val dependents: List<String>) {
// TODO How should dependencies be added, the "implementation" way or "api" way? Does this make this class too complicated and unnecessary as one can just call the Gradle functions directly?
class SourceSetConfig(val type: Type, val name: String, val dependencies: List<String>) {

/**
* @see SourceSetType
Expand Down

0 comments on commit 21c4b3b

Please sign in to comment.