Maven Central publishing - set POM properties #10

Merged
akinwale merged 11 commits from maven-central-pom into master 2021-06-25 17:01:40 +02:00
6 changed files with 121 additions and 35 deletions

0
build-debug.sh Normal file → Executable file
View file

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

View file

@ -7,11 +7,14 @@ buildscript {
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
classpath 'com.android.tools.build:gradle:3.6.4'
}
}
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
allprojects {
repositories {
jcenter()
@ -25,9 +28,9 @@ allprojects {
}
apply plugin: 'com.android.library'
apply plugin: 'com.bmuschko.nexus'
apply plugin: 'maven-publish'
apply plugin: 'signing'
archivesBaseName = 'lbrysdk'
group = "io.lbry"
version = "{{ args.version }}"
@ -101,20 +104,60 @@ subprojects {
}
}
nexus {
sign = true
repositoryUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
snapshotRepositoryUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
nexusPublishing {
repositories {
sonatype {
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
modifyPom {
project {
name 'LBRY SDK for Android'
description 'The LBRY SDK packaged as an Android AAR'
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId 'io.lbry'
artifactId 'lbrysdk64'
version '{{ args.version }}'
from components.release
pom {
name = 'LBRY SDK for Android'
description = 'The LBRY SDK packaged as an Android AAR'
url = 'https://github.com/lbryio/lbry-android-sdk'
licenses {
license {
name = 'MIT License'
url = 'https://raw.githubusercontent.com/lbryio/lbry-android-sdk/master/LICENSE'
}
}
developers {
developer {
id = 'akinwale'
name = 'Akinwale Ariwodola'
email = 'akinwale@lbry.com'
}
}
scm {
url = 'https://github.com/lbryio/lbry-android-sdk'
connection = 'scm:git:github.com/lbryio/lbry-android-sdk.git'
developerConnection = 'scm:git:ssh://github.com/lbryio/lbry-android-sdk.git'
}
}
}
}
}
}
signing {
sign publishing.publications
}
dependencies {
{%- for aar in aars %}

View file

@ -7,11 +7,14 @@ buildscript {
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
classpath 'com.android.tools.build:gradle:3.6.4'
}
}
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
allprojects {
repositories {
jcenter()
@ -24,10 +27,11 @@ allprojects {
}
}
apply plugin: 'com.android.library'
apply plugin: 'com.bmuschko.nexus'
archivesBaseName = 'lbrysdk'
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group = "io.lbry"
version = "{{ args.version }}"
@ -101,20 +105,60 @@ subprojects {
}
}
nexus {
sign = true
repositoryUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
snapshotRepositoryUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
nexusPublishing {
repositories {
sonatype {
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
modifyPom {
project {
name 'LBRY SDK for Android'
description 'The LBRY SDK packaged as an Android AAR'
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId 'io.lbry'
artifactId 'lbrysdk32'
version '{{ args.version }}'
from components.release
pom {
name = 'LBRY SDK for Android'
description = 'The LBRY SDK packaged as an Android AAR'
url = 'https://github.com/lbryio/lbry-android-sdk'
licenses {
license {
name = 'MIT License'
url = 'https://raw.githubusercontent.com/lbryio/lbry-android-sdk/master/LICENSE'
}
}
developers {
developer {
id = 'akinwale'
name = 'Akinwale Ariwodola'
email = 'akinwale@lbry.com'
}
}
scm {
url = 'https://github.com/lbryio/lbry-android-sdk'
connection = 'scm:git:github.com/lbryio/lbry-android-sdk.git'
developerConnection = 'scm:git:ssh://github.com/lbryio/lbry-android-sdk.git'
}
}
}
}
}
}
signing {
sign publishing.publications
}
dependencies {
{%- for aar in aars %}

View file

@ -1,8 +1,9 @@
android.useAndroidX=true
android.enableJetifier=true
nexusUsername={{ env["SONATYPE_USERNAME"] }}
nexusPassword={{ env["SONATYPE_PASSWORD"] }}
ossrhUsername={{ env["SONATYPE_USERNAME"] }}
ossrhPassword={{ env["SONATYPE_PASSWORD"] }}
sonatypeStagingProfileId={{ env["SONATYPE_STAGING_PROFILE_ID"] }}
signing.keyId={{ env["NEXUS_SIGNING_KEY_ID"] }}
signing.password={{ env["NEXUS_SIGNING_KEY_PASSWORD"] }}

View file

@ -845,8 +845,6 @@ class ToolchainCL(object):
# gradle-based build
env["ANDROID_NDK_HOME"] = self.ctx.ndk_dir
env["ANDROID_HOME"] = self.ctx.sdk_dir
env["ORG_GRADLE_PROJECT_bintrayUser"] = environ.get("BINTRAY_USER")
env["ORG_GRADLE_PROJECT_bintrayKey"] = environ.get("BINTRAY_KEY")
gradlew = sh.Command('./gradlew')
if exists('/usr/bin/dos2unix'):
@ -865,7 +863,7 @@ class ToolchainCL(object):
raise BuildInterruptingException(
"Unknown build mode {} for apk()".format(args.build_mode))
output = shprint(gradlew, "--console=plain", gradle_task,
"uploadArchives",
"publishReleasePublicationToSonatypeRepository",
_tail=20,
_critical=True, _env=env)