Skip to content

Commit

Permalink
Fix publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-radhika-s committed Dec 15, 2023
1 parent b88163d commit 8764601
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
id 'com.android.application' version '8.1.1' apply false
id 'com.android.library' version '8.1.1' apply false
id 'org.jetbrains.kotlin.android' version '1.9.10' apply false
id 'io.github.gradle-nexus.publish-plugin' version "1.1.0"
id 'io.github.gradle-nexus.publish-plugin' version "1.3.0"
}

apply from: "${rootDir}/scripts/publish-root.gradle"
Expand Down
5 changes: 4 additions & 1 deletion scripts/publish-module.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

task androidSourcesJar(type: Jar) {
tasks.register('androidSourcesJar', Jar) {
archiveClassifier.set('sources')
if (project.plugins.findPlugin("com.android.library")) {
from android.sourceSets.main.java.srcDirs
Expand All @@ -10,6 +10,7 @@ task androidSourcesJar(type: Jar) {
}
}


artifacts {
archives androidSourcesJar
}
Expand All @@ -20,6 +21,8 @@ afterEvaluate {
publishing {
publications {
release(MavenPublication) {
tasks.named("generateMetadataFileForReleasePublication").configure { dependsOn("androidSourcesJar") }

// The coordinates of the library, being set from variables that
// we'll set up later
groupId PUBLISH_GROUP_ID
Expand Down
5 changes: 5 additions & 0 deletions showcase/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ android {
composeOptions {
kotlinCompilerExtensionVersion compose_compiler_version
}
publishing {
singleVariant("release") {
withSourcesJar()
}
}
}

dependencies {
Expand Down

0 comments on commit 8764601

Please sign in to comment.