Skip to content

Commit

Permalink
fix(kotlin-js): configure sourceSets on the Kotlin extension level
Browse files Browse the repository at this point in the history
Prevent:
w: src/main/kotlin/org/danilopianini/gradle/mavencentral/ProjectExtensions.kt:65:21 '@Property:Deprecated(...) val sourceSets: NamedDomainObjectContainer<KotlinSourceSet>' is deprecated. Accessing 'sourceSets' container on the Kotlin target level DSL is deprecated. Consider configuring 'sourceSets' on the Kotlin extension level.
  • Loading branch information
DanySK authored and renovate[bot] committed Jun 5, 2024
1 parent ecabeb1 commit 9cc590f
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,15 @@ internal object ProjectExtensions {
fun Project.configureJavadocJarTaskForKtJs(sourcesJarTask: Task) {
ifKotlinJsProject { _ ->
configure<KotlinJsProjectExtension> {
js {
sourceSets.getByName("main") {
(sourcesJarTask as? SourceJar)?.run {
sourceSet(it.kotlin)
sourceSet(it.resources)
} ?: logger.warn(
"source sets of task {} not configured because it is not of type {}",
sourcesJarTask.name,
SourceJar::class.java.name,
)
}
sourceSets.getByName("main") {
(sourcesJarTask as? SourceJar)?.run {
sourceSet(it.kotlin)
sourceSet(it.resources)
} ?: logger.warn(
"source sets of task {} not configured because it is not of type {}",
sourcesJarTask.name,
SourceJar::class.java.name,
)
}
}
}
Expand Down

0 comments on commit 9cc590f

Please sign in to comment.