Skip to content

Commit 504a067

Browse files
committed
enables buildConfig for the project
1 parent 73ba813 commit 504a067

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
2+
import com.github.gmazzo.buildconfig.BuildConfigExtension
23
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
34
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
45
import org.jetbrains.kotlinx.dataframe.AnyFrame
@@ -25,6 +26,7 @@ plugins {
2526
alias(docProcessor) apply false
2627
alias(simpleGit) apply false
2728
alias(dependencyVersions)
29+
alias(buildconfig) apply false
2830

2931
// dependence on our own plugin
3032
alias(dataframe) apply false
@@ -154,6 +156,16 @@ allprojects {
154156

155157
// set the java toolchain version to 11 for all subprojects for CI stability
156158
extensions.findByType<KotlinJvmProjectExtension>()?.jvmToolchain(11)
159+
160+
// Attempts to configure buildConfig for each sub-project that uses it
161+
try {
162+
configure<BuildConfigExtension> {
163+
packageName = "org.jetbrains.kotlinx.dataframe"
164+
className = "BuildConfig"
165+
}
166+
} catch (_: UnknownDomainObjectException) {
167+
logger.warn("Could not set buildConfig on :${this.name}")
168+
}
157169
}
158170
}
159171

core/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ plugins {
1919
alias(ktlint)
2020
alias(docProcessor)
2121
alias(simpleGit)
22+
alias(buildconfig)
2223

2324
// dependence on our own plugin
2425
alias(dataframe)

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ android-gradle-api = "7.3.1" # Can't be updated to 7.4.0+ due to Java 8 compatib
5757
ktor-server-netty = "2.3.8"
5858
kotlin-compile-testing = "1.6.0"
5959
duckdb = "0.10.0"
60+
buildconfig = "5.4.0"
6061

6162
[libraries]
6263
ksp-gradle = { group = "com.google.devtools.ksp", name = "symbol-processing-gradle-plugin", version.ref = "ksp" }
@@ -149,3 +150,4 @@ kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
149150
dependencyVersions = { id = "com.github.ben-manes.versions", version.ref = "dependencyVersions" }
150151
plugin-publish = { id = "com.gradle.plugin-publish", version.ref = "plugin-publish" }
151152
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
153+
buildconfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildconfig" }

0 commit comments

Comments
 (0)