Skip to content

Commit 315045c

Browse files
committed
moved instrumentedJars creation to top-level. Made :samples depend on all relevant jars
1 parent de9e1f0 commit 315045c

File tree

5 files changed

+37
-43
lines changed

5 files changed

+37
-43
lines changed

build.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,20 @@ allprojects {
223223
} catch (_: UnknownDomainObjectException) {
224224
logger.warn("Could not set buildConfig on :${this.name}")
225225
}
226+
227+
try {
228+
val instrumentedJars: Configuration by configurations.creating {
229+
isCanBeConsumed = true
230+
isCanBeResolved = false
231+
}
232+
artifacts {
233+
add("instrumentedJars", tasks.jar.get().archiveFile) {
234+
builtBy(tasks.jar)
235+
}
236+
}
237+
} catch (_: Exception) {
238+
logger.warn("Could not set instrumentedJars on :${this.name}")
239+
}
226240
}
227241
}
228242

core/build.gradle.kts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -386,17 +386,6 @@ kotlinPublications {
386386
}
387387
}
388388

389-
val instrumentedJars: Configuration by configurations.creating {
390-
isCanBeConsumed = true
391-
isCanBeResolved = false
392-
}
393-
394-
artifacts {
395-
add("instrumentedJars", tasks.jar.get().archiveFile) {
396-
builtBy(tasks.jar)
397-
}
398-
}
399-
400389
// Disable and enable if updating plugin breaks the build
401390
dataframes {
402391
schema {

dataframe-csv/build.gradle.kts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,3 @@ kotlinPublications {
160160
kotlin {
161161
explicitApi()
162162
}
163-
164-
val instrumentedJars: Configuration by configurations.creating {
165-
isCanBeConsumed = true
166-
isCanBeResolved = false
167-
}
168-
169-
artifacts {
170-
add("instrumentedJars", tasks.jar.get().archiveFile) {
171-
builtBy(tasks.jar)
172-
}
173-
}

dataframe-json/build.gradle.kts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,6 @@ sourceSets {
5959
}
6060
}
6161

62-
val instrumentedJars: Configuration by configurations.creating {
63-
isCanBeConsumed = true
64-
isCanBeResolved = false
65-
}
66-
67-
artifacts {
68-
add("instrumentedJars", tasks.jar.get().archiveFile) {
69-
builtBy(tasks.jar)
70-
}
71-
}
72-
7362
kotlinPublications {
7463
publication {
7564
publicationName = "dataframeJson"

samples/build.gradle.kts

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,34 @@ repositories {
3737
mavenLocal() // for local development
3838
}
3939

40+
val dependentProjectPaths = with(projects) {
41+
listOf(
42+
core,
43+
dataframeArrow,
44+
dataframeExcel,
45+
dataframeJdbc,
46+
dataframeCsv,
47+
dataframeJson,
48+
)
49+
}.map { it.path }
50+
4051
tasks.compileKotlin {
41-
dependsOn(projects.core.path + ":jar")
52+
dependentProjectPaths.forEach {
53+
dependsOn("$it:jar")
54+
}
4255
}
4356

44-
val coreJar = project(projects.core.path).configurations
45-
.getByName("instrumentedJars")
46-
.artifacts.single()
47-
.file.absolutePath
48-
.replace(File.separatorChar, '/')
57+
val jarPaths = dependentProjectPaths.map {
58+
project(it).configurations
59+
.getByName("instrumentedJars")
60+
.artifacts.single()
61+
.file.absolutePath
62+
.replace(File.separatorChar, '/')
63+
}
4964

5065
dependencies {
51-
implementation(projects.dataframe) {
52-
// exclude(group, "dataframe-core")
53-
}
54-
implementation(files(coreJar))
66+
// implementation(projects.dataframe) Must depend on jars for the compiler plugin to work!
67+
implementation(files(jarPaths))
5568

5669
testImplementation(libs.junit)
5770
testImplementation(libs.kotestAssertions) {

0 commit comments

Comments
 (0)