diff --git a/android-sample/src/main/AndroidManifest.xml b/android-sample/src/main/AndroidManifest.xml index 1acbfea4..9508ead9 100644 --- a/android-sample/src/main/AndroidManifest.xml +++ b/android-sample/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/build.gradle.kts b/build.gradle.kts index c90e3dfc..c0055073 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,9 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. -import com.android.build.gradle.LibraryExtension import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties import org.jetbrains.dokka.gradle.DokkaMultiModuleTask import org.jetbrains.dokka.gradle.DokkaTaskPartial -import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { @@ -64,6 +62,10 @@ subprojects { return@afterEvaluate } + tasks.withType().configureEach { + dependsOn(tasks.withType()) + } + tasks.named("dokkaHtmlPartial").configure { dokkaSourceSets.configureEach { reportUndocumented.set(true) @@ -81,27 +83,27 @@ subprojects { archiveClassifier.set("javadoc") from(tasks.dokkaJavadoc.flatMap { it.outputDirectory }) } - } - - afterEvaluate { - val androidExtension = extensions.findByType() - val multiplatformExtension = extensions.findByType() - fun MavenPublication.configure() { - if (multiplatformExtension == null && androidExtension != null) { - val androidSourcesJar by tasks.registering(Jar::class) { - archiveClassifier.set("sources") - from(androidExtension.sourceSets["main"].java.srcDirs) - } - artifact(androidSourcesJar.get()) - from(components["release"]) + if (tasks.names.contains("publishKotlinMultiplatformPublicationToMavenRepository")) { + tasks.named("publishKotlinMultiplatformPublicationToMavenRepository").configure { + dependsOn("signJvmPublication") } + } - artifact(tasks.named("javadocJar").get()) + if (tasks.names.contains("publishAndroidReleasePublicationToMavenRepository")) { + tasks.named("publishAndroidReleasePublicationToMavenRepository").configure { + dependsOn("signJvmPublication") + } + } + } + afterEvaluate { + fun MavenPublication.configure() { groupId = property("GROUP").toString() version = property("VERSION_NAME").toString() + artifact(tasks.named("javadocJar").get()) + pom { name.set(property("POM_NAME").toString()) description.set(property("POM_DESCRIPTION").toString()) @@ -157,16 +159,8 @@ subprojects { } } - if (multiplatformExtension != null) { - publications.withType().configureEach { - configure() - } - } else if (androidExtension != null) { - // Add publications for Android libraries. - // KMP libraries already have MavenPublications that are added by multiplatform plugin - publications.register("release") { - afterEvaluate { configure() } - } + publications.withType().configureEach { + configure() } } diff --git a/buildSrc/src/main/kotlin/richtext-android-library.gradle.kts b/buildSrc/src/main/kotlin/richtext-android-library.gradle.kts index 6ae88989..847099a6 100644 --- a/buildSrc/src/main/kotlin/richtext-android-library.gradle.kts +++ b/buildSrc/src/main/kotlin/richtext-android-library.gradle.kts @@ -32,4 +32,10 @@ android { composeOptions { kotlinCompilerExtensionVersion = Compose.compilerVersion } + + publishing { + singleVariant("release") { + withSourcesJar() + } + } } diff --git a/buildSrc/src/main/kotlin/richtext-kmp-library.gradle.kts b/buildSrc/src/main/kotlin/richtext-kmp-library.gradle.kts index 62f80838..a6b24041 100644 --- a/buildSrc/src/main/kotlin/richtext-kmp-library.gradle.kts +++ b/buildSrc/src/main/kotlin/richtext-kmp-library.gradle.kts @@ -13,7 +13,7 @@ repositories { kotlin { jvm() android { - publishLibraryVariants("release", "debug") + publishLibraryVariants("release") compilations.all { kotlinOptions.jvmTarget = "11" } diff --git a/richtext-commonmark/src/androidMain/AndroidManifest.xml b/richtext-commonmark/src/androidMain/AndroidManifest.xml index d3878ea6..227314ee 100644 --- a/richtext-commonmark/src/androidMain/AndroidManifest.xml +++ b/richtext-commonmark/src/androidMain/AndroidManifest.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/richtext-ui-material/src/androidMain/AndroidManifest.xml b/richtext-ui-material/src/androidMain/AndroidManifest.xml index 14516796..227314ee 100644 --- a/richtext-ui-material/src/androidMain/AndroidManifest.xml +++ b/richtext-ui-material/src/androidMain/AndroidManifest.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/richtext-ui-material3/src/androidMain/AndroidManifest.xml b/richtext-ui-material3/src/androidMain/AndroidManifest.xml index befd80a5..227314ee 100644 --- a/richtext-ui-material3/src/androidMain/AndroidManifest.xml +++ b/richtext-ui-material3/src/androidMain/AndroidManifest.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/richtext-ui/src/androidMain/AndroidManifest.xml b/richtext-ui/src/androidMain/AndroidManifest.xml index 39688d8b..227314ee 100644 --- a/richtext-ui/src/androidMain/AndroidManifest.xml +++ b/richtext-ui/src/androidMain/AndroidManifest.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/slideshow/src/main/AndroidManifest.xml b/slideshow/src/main/AndroidManifest.xml index dbf799a7..cc947c56 100644 --- a/slideshow/src/main/AndroidManifest.xml +++ b/slideshow/src/main/AndroidManifest.xml @@ -1 +1 @@ - +