Skip to content

Commit

Permalink
Add Kotlin with specific custom version
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierSegoviaCordoba committed Dec 10, 2024
1 parent a913245 commit c70101f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
hubdle = "0.8.1"
hubdleCatalog = "0.4.1"
javiersc-kotlin-compiler-extensions = "0.5.1+2.1.0"
jetbrains-kotlin = "2.1.0"

[libraries]
hubdle-catalog = { module = "com.javiersc.hubdle:hubdle-version-catalog", version.ref = "hubdleCatalog" }
javiersc-kotlin-compiler-extensions = { module = "com.javiersc.kotlin:kotlin-compiler-extensions", version.ref = "javiersc-kotlin-compiler-extensions" }
javiersc-kotlin-compiler-gradle-extensions = { module = "com.javiersc.kotlin:kotlin-compiler-gradle-extensions", version.ref = "javiersc-kotlin-compiler-extensions" }
javiersc-kotlin-compiler-test-extensions = { module = "com.javiersc.kotlin:kotlin-compiler-test-extensions", version.ref = "javiersc-kotlin-compiler-extensions" }
jetbrains-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "jetbrains-kotlin" }

[plugins]
javiersc-hubdle = { id = "com.javiersc.hubdle", version.ref = "hubdle" }
25 changes: 25 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,43 @@ dependencyResolutionManagement {
}
}

buildscript {
dependencies {
val kotlinVersion: String =
file("$rootDir/gradle/libs.versions.toml")
.readLines()
.first { it.contains("jetbrains-kotlin") }
.split("\"")[1]

val kotlinModule =
file("$rootDir/gradle/libs.versions.toml")
.readLines()
.first { it.contains("jetbrains-kotlin-gradle-plugin") }
.split("\"")[1]

val kotlinDependency = "$kotlinModule:$kotlinVersion"
classpath(kotlinDependency)
}
}

val catalogFile = file("$rootDir/gradle/libs.versions.toml").readLines()

val hubdleCatalogVersion: String =
catalogFile.first { it.contains("hubdleCatalog =") }.split("\"")[1]
val kotlinCompilerExtensionsVersion: String =
catalogFile.first { it.contains("javiersc-kotlin-compiler-extensions =") }.split("\"")[1]

val kotlinVersion: String =
catalogFile
.first { it.contains("jetbrains-kotlin") }
.split("\"")[1]

hubdleSettings {
catalog { //
version(hubdleCatalogVersion)
replaceVersion(
"javiersc-kotlin-compiler-extensions" to kotlinCompilerExtensionsVersion,
"jetbrains-kotlin" to kotlinVersion,
)
}
}
Expand Down

0 comments on commit c70101f

Please sign in to comment.