Waldemar Kornewald
05/04/2023, 11:00 AMandroid { publishing { ... } }
block also doesn’t respect when you leave out withSourcesJar()
. Kotlin seems to always publish the sources, no matter what you set.tapchicoma
05/04/2023, 12:11 PMAnton Lakotka [JB]
05/04/2023, 12:54 PMwithSourcesJar(publish = false)
check related issue https://youtrack.jetbrains.com/issue/KT-55881
For 1.8.20 let me think how can I help you with disabling itephemient
05/04/2023, 3:23 PMtasks.named("...").configure { isEnabled = false }
) might work? not sure if it might still appear somehow though, didn't test...Waldemar Kornewald
05/05/2023, 7:57 AMWaldemar Kornewald
05/05/2023, 8:55 AMafterEvaluate { ... }
and use tasks.findAll
to filter out all sourcesJar tasks because they might be prefixed like debugSourcesJarephemient
05/05/2023, 9:41 AMtasks.withType<org.gradle.jvm.tasks.Jar>().configureEach {
onlyIf("Do not publish sources") { archiveClassifier.getOrNull() != "sources" }
}
should work without any afterEvaluate