From ea1cbd019af6fd179c73e36f51ccd2d9ddbd3357 Mon Sep 17 00:00:00 2001 From: Michael Avoyan Date: Tue, 25 Jun 2024 13:33:36 +0300 Subject: [PATCH 1/2] fix publish gradle --- VCL/build.gradle | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/VCL/build.gradle b/VCL/build.gradle index e89c69f..f65d5eb 100644 --- a/VCL/build.gradle +++ b/VCL/build.gradle @@ -123,7 +123,7 @@ afterEvaluate { from components.java } -// artifact androidSourcesJar + artifact androidSourcesJar // Mostly self-explanatory metadata pom { @@ -167,7 +167,7 @@ afterEvaluate { from components.java } -// artifact androidSourcesJar + artifact androidSourcesJar // Mostly self-explanatory metadata pom { @@ -201,21 +201,22 @@ afterEvaluate { } } } + signing { useInMemoryPgpKeys( rootProject.ext.signingKeyId, rootProject.ext.signingPrivateKey, - rootProject.ext.signingPassword, + rootProject.ext.signingPassword ) sign publishing.publications } tasks.named("publishRcPublicationToSonatypeRepository").configure { - dependsOn tasks.named("signReleasePublication") + dependsOn tasks.named("signRcPublication") } tasks.named("publishReleasePublicationToSonatypeRepository").configure { - dependsOn tasks.named("signRcPublication") + dependsOn tasks.named("signReleasePublication") } } From 477e55efb760d430fdac7fd9c4fb7f6ddd93ba04 Mon Sep 17 00:00:00 2001 From: Michael Avoyan Date: Tue, 25 Jun 2024 15:00:44 +0300 Subject: [PATCH 2/2] Update build.gradle --- VCL/build.gradle | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/VCL/build.gradle b/VCL/build.gradle index f65d5eb..7a199cd 100644 --- a/VCL/build.gradle +++ b/VCL/build.gradle @@ -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 { @@ -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 { @@ -211,12 +216,18 @@ afterEvaluate { 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") } }