1+ import com.powersync.plugins.sonatype.SonatypeCentralUploadPlugin
2+
13import com.sun.net.httpserver.HttpExchange
24import com.sun.net.httpserver.HttpServer
35import java.net.InetSocketAddress
@@ -21,21 +23,29 @@ plugins {
2123 alias(libs.plugins.androidx.room) apply false
2224 id(" org.jetbrains.dokka" ) version libs.versions.dokkaBase
2325 id(" dokka-convention" )
26+ id(" com.powersync.plugins.sonatype" ) apply false
2427}
2528
2629tasks.getByName<Delete >(" clean" ) {
2730 delete(rootProject.layout.buildDirectory)
2831}
2932
33+ val sonatypePublishingBundleConfiguration by configurations.creating {
34+ isCanBeConsumed = false
35+ }
36+
3037// Merges individual module docs into a single HTML output
3138dependencies {
32- dokka(projects.common)
33- dokka(projects.core)
34- dokka(projects.compose)
35- dokka(projects.integrations.room)
36- dokka(projects.integrations.sqldelight)
37- dokka(projects.integrations.supabase)
38- dokka(projects.sqlite3multipleciphers)
39+ // Internal published projects we don't include in the Dokka overview.
40+ val undocumentedProjects = listOf (" :static-sqlite-driver" , " :internal:sqlite3mcandroid" )
41+
42+ for (projectPath in SonatypeCentralUploadPlugin .publishedProjects) {
43+ if (! undocumentedProjects.contains(projectPath)) {
44+ dokka(project(path= projectPath))
45+ }
46+
47+ sonatypePublishingBundleConfiguration(project(path= projectPath, configuration= " sonatypePublishingBundleConfiguration" ))
48+ }
3949}
4050
4151dokka {
@@ -100,3 +110,26 @@ tasks.register("serveDokka") {
100110 Thread .currentThread().join()
101111 }
102112}
113+
114+ val generatePublishingBundle by tasks.registering(Copy ::class ) {
115+ group = " publishing"
116+
117+ val subprojects: FileCollection = sonatypePublishingBundleConfiguration
118+ inputs.files(subprojects)
119+
120+ from(subprojects.files.toTypedArray()) {
121+ exclude { fileTreeElement ->
122+ val name = fileTreeElement.relativePath.lastName
123+ // Skip some files: We don't need to upload maven metadata as Sonatype generates
124+ // those files for us. There's no way to disable sha512 hashes in Gradle (and it
125+ // insists on hashing signatures), we don't need those files either.
126+ name.startsWith(" maven-metadata" ) ||
127+ name.endsWith(" .sha512" ) ||
128+ name.endsWith(" .asc.md5" ) ||
129+ name.endsWith(" .asc.sha1" ) ||
130+ name.endsWith(" .asc.sha256" ) ||
131+ name.endsWith(" .asc.sha512" )
132+ }
133+ }
134+ into(layout.buildDirectory.dir(" sonatypeBundle" ).get())
135+ }
0 commit comments