Skip to content

Commit

Permalink
Merge pull request #117 from velocitycareerlabs/VL-7885-fix-publishing-5
Browse files Browse the repository at this point in the history
fix publish gradle
  • Loading branch information
michaelavoyan authored Jun 25, 2024
2 parents 1bb374a + 477e55e commit 0371831
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions VCL/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,21 @@ afterEvaluate {
rc(MavenPublication) {
groupId getGroupId()
artifactId getArtifactId()

// // define rc version name
// def vers = getVersionName()
// def rcSuffix = rootProject.ext.rcSuffix
// version = "${vers}-${rcSuffix}"
version getVersionName()

// Two artifacts, the `aar` (or `jar`) and the sources
// Main artifact
if (project.plugins.findPlugin("com.android.library")) {
from components.release
artifact("$buildDir/outputs/aar/${project.name}-release.aar") {
builtBy tasks.named('assembleRelease')
}
} else {
from components.java
artifact("$buildDir/libs/${project.name}.jar") {
builtBy tasks.named('jar')
}
}

// artifact androidSourcesJar
// Sources jar artifact
artifact(tasks.named('androidSourcesJar'))

// Mostly self-explanatory metadata
pom {
Expand Down Expand Up @@ -160,14 +160,19 @@ afterEvaluate {
artifactId getArtifactId()
version getVersionName()

// Two artifacts, the `aar` (or `jar`) and the sources
// Main artifact
if (project.plugins.findPlugin("com.android.library")) {
from components.release
artifact("$buildDir/outputs/aar/${project.name}-release.aar") {
builtBy tasks.named('assembleRelease')
}
} else {
from components.java
artifact("$buildDir/libs/${project.name}.jar") {
builtBy tasks.named('jar')
}
}

// artifact androidSourcesJar
// Sources jar artifact
artifact(tasks.named('androidSourcesJar'))

// Mostly self-explanatory metadata
pom {
Expand Down Expand Up @@ -201,20 +206,27 @@ afterEvaluate {
}
}
}

signing {
useInMemoryPgpKeys(
rootProject.ext.signingKeyId,
rootProject.ext.signingPrivateKey,
rootProject.ext.signingPassword,
rootProject.ext.signingPassword
)
sign publishing.publications
}

tasks.named('generateMetadataFileForRcPublication') {
dependsOn tasks.named('androidSourcesJar')
}

tasks.named("publishRcPublicationToSonatypeRepository").configure {
dependsOn tasks.named("signRcPublication")
dependsOn tasks.named("signReleasePublication")
}

tasks.named("publishReleasePublicationToSonatypeRepository").configure {
dependsOn tasks.named("signReleasePublication")
dependsOn tasks.named("signRcPublication")
}
}
Expand Down

0 comments on commit 0371831

Please sign in to comment.