|
| 1 | +apply plugin: 'maven-publish' |
| 2 | +apply plugin: 'signing' |
| 3 | +apply plugin: 'org.jetbrains.dokka' |
| 4 | + |
| 5 | +tasks.register('androidSourcesJar', Jar) { |
| 6 | + archiveClassifier.set('sources') |
| 7 | + if (project.plugins.findPlugin("com.android.library")) { |
| 8 | + from android.sourceSets.main.java.srcDirs |
| 9 | + from android.sourceSets.main.kotlin.srcDirs |
| 10 | + } else { |
| 11 | + from sourceSets.main.java.srcDirs |
| 12 | + from sourceSets.main.kotlin.srcDirs |
| 13 | + } |
| 14 | +} |
| 15 | + |
| 16 | +tasks.withType(dokkaHtmlPartial.getClass()).configureEach { |
| 17 | + pluginsMapConfiguration.set( |
| 18 | + ["org.jetbrains.dokka.base.DokkaBase": """{ "separateInheritedMembers": true}"""] |
| 19 | + ) |
| 20 | +} |
| 21 | + |
| 22 | +task javadocJar(type: Jar, dependsOn: dokkaJavadoc) { |
| 23 | + archiveClassifier.set('javadoc') |
| 24 | + from dokkaJavadoc.outputDirectory |
| 25 | +} |
| 26 | + |
| 27 | +artifacts { |
| 28 | + archives androidSourcesJar |
| 29 | + archives javadocJar |
| 30 | +} |
| 31 | + |
| 32 | +group = PUBLISH_GROUP_ID |
| 33 | +version = PUBLISH_VERSION |
| 34 | + |
| 35 | +afterEvaluate { |
| 36 | + publishing { |
| 37 | + publications { |
| 38 | + release(MavenPublication) { |
| 39 | + tasks.named("generateMetadataFileForReleasePublication").configure { dependsOn("androidSourcesJar") } |
| 40 | + groupId PUBLISH_GROUP_ID |
| 41 | + artifactId PUBLISH_ARTIFACT_ID |
| 42 | + version PUBLISH_VERSION |
| 43 | + if (project.plugins.findPlugin("com.android.library")) { |
| 44 | + from components.release |
| 45 | + } else { |
| 46 | + from components.java |
| 47 | + } |
| 48 | + |
| 49 | + artifact javadocJar |
| 50 | + |
| 51 | + pom { |
| 52 | + name = PUBLISH_ARTIFACT_ID |
| 53 | + description = 'Stream Core official Android SDK' |
| 54 | + url = 'https://github.com/getstream/stream-android-core' |
| 55 | + licenses { |
| 56 | + license { |
| 57 | + name = 'Stream License' |
| 58 | + url = 'https://github.com/GetStream/stream-android-core/blob/main/LICENSE' |
| 59 | + } |
| 60 | + } |
| 61 | + developers { |
| 62 | + developer { |
| 63 | + id = 'jcminarro' |
| 64 | + name = 'Jc Miñarro' |
| 65 | + |
| 66 | + } |
| 67 | + developer { |
| 68 | + id = 'aleksandar-apostolov' |
| 69 | + name = 'Aleksandar Apostolov' |
| 70 | + |
| 71 | + } |
| 72 | + developer { |
| 73 | + id = 'VelikovPetar' |
| 74 | + name = 'Petar Velikov' |
| 75 | + |
| 76 | + } |
| 77 | + developer { |
| 78 | + id = 'andremion' |
| 79 | + name = 'André Mion' |
| 80 | + |
| 81 | + } |
| 82 | + developer { |
| 83 | + id = 'rahul-lohra' |
| 84 | + name = 'Rahul Kumar Lohra' |
| 85 | + |
| 86 | + } |
| 87 | + developer { |
| 88 | + id = 'gpunto' |
| 89 | + name = 'Gianmarco' |
| 90 | + |
| 91 | + } |
| 92 | + } |
| 93 | + scm { |
| 94 | + connection = 'scm:git:github.com/getstream/stream-android-core.git' |
| 95 | + developerConnection = 'scm:git:ssh://github.com/getstream/stream-android-core.git' |
| 96 | + url = 'https://github.com/getstream/stream-android-core/tree/main' |
| 97 | + } |
| 98 | + } |
| 99 | + } |
| 100 | + } |
| 101 | + } |
| 102 | +} |
| 103 | + |
| 104 | +signing { |
| 105 | + useInMemoryPgpKeys( |
| 106 | + rootProject.ext["signing.keyId"], |
| 107 | + rootProject.ext["signing.key"], |
| 108 | + rootProject.ext["signing.password"], |
| 109 | + ) |
| 110 | + sign publishing.publications |
| 111 | +} |
0 commit comments