Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-radhika-s committed Aug 15, 2023
1 parent 47c875b commit dd261af
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion countrypicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

ext {
PUBLISH_GROUP_ID = 'com.canopas.jetcountrypicker'
PUBLISH_VERSION = '1.0.8-alpha03'
PUBLISH_VERSION = '1.0.9-alpha01'
PUBLISH_ARTIFACT_ID = 'jetcountrypicker'
}
apply from: "${rootDir}/scripts/publish-module.gradle"
Expand Down
23 changes: 20 additions & 3 deletions scripts/publish-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,36 @@ apply plugin: 'signing'
group = PUBLISH_GROUP_ID
version = PUBLISH_VERSION

tasks.register('androidSourcesJar', Jar) {
archiveClassifier.set('sources')
if (project.plugins.findPlugin("com.android.library")) {
from android.sourceSets.main.kotlin.srcDirs
} else {
from sourceSets.main.kotlin.srcDirs
}
}

artifacts {
archives androidSourcesJar
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
// The coordinates of the library, being set from variables that
// we'll set up later
tasks.named("generateMetadataFileForReleasePublication").configure { dependsOn("androidSourcesJar") }

groupId PUBLISH_GROUP_ID
artifactId PUBLISH_ARTIFACT_ID
version PUBLISH_VERSION

from components.release
if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
artifact("$buildDir/libs/${project.getName()}-${version}.jar")
}

artifact androidSourcesJar
// Mostly self-explanatory metadata
pom {
name = PUBLISH_ARTIFACT_ID
Expand Down

0 comments on commit dd261af

Please sign in to comment.