Davide Giuseppe Farella
06/06/2020, 3:30 PMpublish
and publishAndroid
are helpers that I wrote and internally do:
apply(plugin = "com.jfrog.bintray")
apply(plugin = "maven-publish")
group = ...
version = ...
afterEvaluate {
publishing { ... }
configure<BintrayExtension> { ... }
}
Javier
06/06/2020, 7:40 PMDavide Giuseppe Farella
06/06/2020, 7:42 PMJavier
06/06/2020, 7:50 PMDavide Giuseppe Farella
06/06/2020, 7:52 PMconfigure
block, I though only about the apply(plugin
Have you got any example of doc about that? I always found different parts of examples in different placesJavier
06/06/2020, 8:02 PMDavide Giuseppe Farella
06/06/2020, 9:57 PMafterEvaluate
block, that would make some more complicationJavier
06/08/2020, 10:09 AMDavide Giuseppe Farella
06/08/2020, 10:13 AMval bundle = c.publicationsBundleBuilder(this@publishBlock)
val sourcesJar = tasks.create<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(bundle.sources)
}
afterEvaluate {
artifact(javaDocsJar)
artifact(tasks[if (isAndroid) "bundleReleaseAar" else "jar"])
artifact(sourcesJar)
}
Where the pubBundleBuilder would return sourceSets["main"].allSource
from java and android.sourceSets["main"].java.srcDirs
on Android ( so ofc I needed 2 different methods to call for that and was not MultiPlatform ready I guess )
• How should I implement that commented part?
private fun Project.publish(lazy: Boolean, c: PublishConfig) {
apply(plugin = "maven-publish")
// apply(plugin = "signing")
// signing {
// useGpgCmd()
// sign(publishing.publications)
// }
Javier
06/08/2020, 1:50 PMkotlin
block as you can see here https://github.com/JavierSegoviaCordoba/Core/blob/develop/core/build.gradle.kts
android {
publishLibraryVariants("release", "debug")
}
Davide Giuseppe Farella
06/08/2020, 2:15 PMkotlin-dsl
module without the Android plugin?Javier
06/08/2020, 2:28 PMDavide Giuseppe Farella
06/08/2020, 2:31 PMpublish
/ publishAndroid
and in the one without Android I’m not applying the plugin ( and neither the dependency from the Android plugin, so I don’t have access to LibraryExtension
for example )Javier
06/08/2020, 2:35 PMDavide Giuseppe Farella
06/08/2020, 2:38 PMJavier
06/08/2020, 3:01 PMDavide Giuseppe Farella
06/08/2020, 3:03 PM