Skip to content

Commit

Permalink
Fix Maven Central publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-menu committed Jan 19, 2024
1 parent 361d2d4 commit 3ebda73
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions scripts/publish-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,15 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'org.jetbrains.dokka'

task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
if (project.plugins.findPlugin("com.android.library")) {
// // For Android libraries
from android.sourceSets.main.java.srcDirs
from android.sourceSets.main.kotlin.srcDirs
} else {
// For pure Kotlin libraries
from sourceSets.main.java.srcDirs
from sourceSets.main.kotlin.srcDirs
android {
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
archiveClassifier.set('javadoc')
from dokkaJavadoc.outputDirectory
}

artifacts {
archives androidSourcesJar
archives javadocJar
}

group = rootProject.ext["publish.groupId"]
version = rootProject.ext["publish.version"]

Expand All @@ -48,9 +34,6 @@ afterEvaluate {
from components.java
}

artifact androidSourcesJar
artifact javadocJar

pom {
name = rootProject.ext["publish.artifactId"]
description = 'A toolkit for ebooks, audiobooks and comics written in Kotlin'
Expand Down

0 comments on commit 3ebda73

Please sign in to comment.