Skip to content

Commit

Permalink
updated publish-module.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
2307vivek committed Nov 29, 2023
1 parent 957a7e8 commit d6e26f3
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions scripts/publish-module.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

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, in case you have them
from sourceSets.main.java.srcDirs
from sourceSets.main.kotlin.srcDirs
}
}
//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, in case you have them
// from sourceSets.main.java.srcDirs
// from sourceSets.main.kotlin.srcDirs
// }
//}

artifacts {
archives androidSourcesJar
android {
publishing {
singleVariant("release") {
withJavadocJar()
withSourcesJar()
}
}
}

group = PUBLISH_GROUP_ID
Expand All @@ -38,7 +43,7 @@ afterEvaluate {
from components.java
}

artifact androidSourcesJar
//artifact androidSourcesJar

// Mostly self-explanatory metadata
pom {
Expand Down

0 comments on commit d6e26f3

Please sign in to comment.