Skip to content

Commit

Permalink
Detect the Kotlin version at runtime rather than hard-coding it. (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg authored Jan 27, 2025
2 parents 89d2419 + 45c0be8 commit d691de0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## [Unreleased]
### Changed
- Bump all dependencies to latest.
- Bump required JVM from 11 to 17. ([#63](https://github.com/diffplug/atplug/pull/63))
- Detect Kotlin version rather than harcode it. ([#64](https://github.com/diffplug/atplug/pull/64))

## [1.1.1] - 2024-07-06
### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ class PlugPlugin : Plugin<Project> {
project.plugins.apply(JavaPlugin::class.java)
val javaExtension = project.extensions.getByType(JavaPluginExtension::class.java)
val main = javaExtension.sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME)
val dep = project.dependencies.create("org.jetbrains.kotlin:kotlin-reflect:1.8.20")
val plugin =
project.plugins.findPlugin("org.jetbrains.kotlin.jvm")
as org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
val dep =
project.dependencies.create("org.jetbrains.kotlin:kotlin-reflect:${plugin.pluginVersion}")
val plugGenConfig =
project.configurations.create("plugGenerate") { plugGen: Configuration ->
plugGen.extendsFrom(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PlugGeneratorTest : ResourceHarness() {
true,
listOf(
"org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1",
"org.jetbrains.kotlin:kotlin-reflect:1.8.20"))
"org.jetbrains.kotlin:kotlin-reflect:2.1.0"))
val atplug_runtime = mutableSetOf(findRuntimeJar())
atplug_runtime.addAll(transitives)
return atplug_runtime
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ subprojects {
dependencies {
implementation "org.ow2.asm:asm:9.7.1"
implementation 'com.diffplug.gradle:goomph:4.2.0'
implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0'
testImplementation 'org.assertj:assertj-core:3.27.3'
}
tasks.named('test') {
Expand Down

0 comments on commit d691de0

Please sign in to comment.