Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ abstract class VerifyCoreCompilationArtifactTask : DefaultTask() {
actual = binaryEntries.keys.filterTo(sortedSetOf()) { it.endsWith(".class") },
)

val expectedSources =
relativeFiles(sourceDirectory.get().asFile, ".kt").mapTo(sortedSetOf()) { "main/$it" }
val expectedSources = relativeFiles(sourceDirectory.get().asFile, ".kt").toSortedSet()
check(expectedSources.isNotEmpty()) { "The core source directory is empty." }

val sourceEntries = zipEntryCounts(sourcesJar.get().asFile)
Expand All @@ -72,7 +71,7 @@ abstract class VerifyCoreCompilationArtifactTask : DefaultTask() {
"Public API class must appear exactly once in the core jar: $className"
}

val sourceEntry = "main/${className.substringBefore('$').replace('.', '/')}.kt"
val sourceEntry = "${className.substringBefore('$').replace('.', '/')}.kt"
check(sourceEntries[sourceEntry] == 1) {
"Public API source must appear exactly once in the core sources jar: $className"
}
Expand Down
8 changes: 1 addition & 7 deletions openai-java-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,7 @@ val coreJar = tasks.named<Jar>("jar") {

val coreSourcesJar = tasks.named<Jar>("kotlinSourcesJar") {
duplicatesStrategy = DuplicatesStrategy.FAIL
from(
fileTree("src/main/kotlin").matching {
include(CoreCompilationClaimedSourceIncludeSpec())
}
) {
into("main")
}
from(fileTree("src/main/kotlin").matching { include(CoreCompilationClaimedSourceIncludeSpec()) })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the prefix from all core sources

When :openai-java-core:kotlinSourcesJar runs, the task's preconfigured source-set copy still emits the unclaimed client/helper sources under main/com/...; this added from only relocates the shard-owned sources that were manually restored after the source-set exclusion. The resulting JAR therefore has a split layout, and the updated verifyCoreCompilationArtifact—which check depends on—reports the remaining main/... entries as unexpected and their root-level counterparts as missing. Reconfigure the task's existing copy spec, or rebuild its contents from the complete source tree, so every source is relocated together.

Useful? React with 👍 / 👎.

}

val verifyCoreCompilationArtifact =
Expand Down