Skip to content

Commit 97a7971

Browse files
committed
chore: Use new catalog to avoid conflict with default one.
1 parent 547ebfd commit 97a7971

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ otel = "1.46.0"
5959
otel-instr = "2.12.0"
6060
otel-instr-alpha = "2.12.0-alpha"
6161
otel-semconv = "1.29.0-alpha"
62-
otel-samplers = "1.42.0-alpha"
62+
otel-samplers = "1.43.0-alpha"
6363
elastic-otel = "0.4.0"
6464
okio = "3.9.1"
6565
sslcontext-kickstart = "9.0.0"

plugins/build.gradle.kts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ tasks {
5959

6060
withType<GenerateJteTask>().configureEach { mustRunAfter("sourcesJar") }
6161

62-
// Hack to include the generated version catalog accessors to the final jar
63-
// named<Jar>("jar") {
64-
// from(sourceSets.main.get().output)
65-
// from(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
66-
// archiveClassifier = ""
67-
// }
62+
// Include the generated build version catalog (blibs) accessors to the final jar
63+
named<Jar>("jar") {
64+
from(sourceSets.main.get().output)
65+
from(files(blibs.javaClass.superclass.protectionDomain.codeSource.location))
66+
archiveClassifier = ""
67+
}
6868
}
6969

7070
jte {
@@ -170,7 +170,7 @@ dependencies {
170170
implementation(libs.build.tomlj)
171171

172172
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
173-
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
173+
implementation(files(blibs.javaClass.superclass.protectionDomain.codeSource.location))
174174

175175
// implementation(libs.build.kotlin.compose.compiler)
176176
// implementation(libs.build.karakum.plugin)

plugins/src/main/kotlin/common/ProjectExtns.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import java.io.ByteArrayOutputStream
77
import java.io.File
88
import java.nio.file.Path
99
import org.graalvm.buildtools.gradle.dsl.GraalVMExtension
10-
import org.gradle.accessors.dm.LibrariesForLibs
10+
import org.gradle.accessors.dm.LibrariesForBlibs
1111
import org.gradle.api.Action
1212
import org.gradle.api.JavaVersion
1313
import org.gradle.api.Project
@@ -32,9 +32,9 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3232

3333
// val logger = LoggerFactory.getLogger("build-logic")
3434

35-
/** Returns version catalog of this project. */
35+
/** Returns the version catalog of this project. */
3636
internal val Project.libs
37-
get() = the<LibrariesForLibs>()
37+
get() = the<LibrariesForBlibs>()
3838

3939
/**
4040
* Returns version catalog extension of this project. Give access to all version catalogs available.

sandbox/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencyResolutionManagement {
3838
repositoriesMode = RepositoriesMode.PREFER_SETTINGS
3939

4040
versionCatalogs {
41-
create("libs") {
41+
create("blibs") {
4242
from("dev.suresh.build:catalog:+")
4343
version("java", "21")
4444
}

settings.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ pluginManagement {
66
includeBuild("gradle/build-logic")
77
}
88

9+
dependencyResolutionManagement {
10+
versionCatalogs {
11+
// Use a new catalog to avoid conflict.
12+
register("blibs") { from(files("gradle/libs.versions.toml")) }
13+
}
14+
}
15+
916
plugins { id("settings.repo") }
1017

1118
rootProject.name = "build-commons"

0 commit comments

Comments
 (0)