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
3 changed files with 113 additions and 55 deletions
Showing only changes of commit ea252a99d1 - Show all commits

View file

@ -8,7 +8,6 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
@ -24,10 +23,14 @@ allprojects {
}
}
apply plugin: 'com.android.library'
apply plugin: 'com.bmuschko.nexus'
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
archivesBaseName = 'lbrysdk'
group = "io.lbry"
version = "{{ args.version }}"
@ -97,44 +100,70 @@ subprojects {
compileSdkVersion {{ android_api }}
buildToolsVersion '{{ build_tools_version }}'
}
modifyPom {
project {
name 'LBRY SDK for Android'
description 'The LBRY SDK packaged as an Android AAR'
groupId 'io.lbry'
artifactId 'lbrysdk64'
scm {
url 'https://github.com/lbryio/lbry-android-sdk'
connection 'scm:https://github.com/lbryio/lbry-android-sdk.git'
developerConnection 'scm:git://github.com/lbryio/lbry-android-sdk.git'
}
}
}
}
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/"))
}
}
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId 'io.lbry'
artifactId 'lbrysdk64'
version {{ args.version }}
if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
from components.java
}
artifact androidSourcesJar
artifact javadocJar
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'
distribution 'repo'
name = 'MIT License'
url = 'https://raw.githubusercontent.com/lbryio/lbry-android-sdk/master/LICENSE'
}
}
developers {
developer {
id 'shockr'
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'
}
}
}
}
}
}
nexus {
sign = true
repositoryUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
snapshotRepositoryUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
signing {
sign publishing.publications
}
dependencies {

View file

@ -8,7 +8,6 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
@ -24,10 +23,14 @@ allprojects {
}
}
apply plugin: 'com.android.library'
apply plugin: 'com.bmuschko.nexus'
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
archivesBaseName = 'lbrysdk'
group = "io.lbry"
version = "{{ args.version }}"
@ -97,45 +100,70 @@ subprojects {
compileSdkVersion {{ android_api }}
buildToolsVersion '{{ build_tools_version }}'
}
modifyPom {
project {
name 'LBRY SDK for Android'
description 'The LBRY SDK packaged as an Android AAR'
url 'https://github.com/lbryio/lbry-android-sdk'
groupId 'io.lbry'
artifactId 'lbrysdk32'
scm {
url 'https://github.com/lbryio/lbry-android-sdk'
connection 'scm:https://github.com/lbryio/lbry-android-sdk.git'
developerConnection 'scm:git://github.com/lbryio/lbry-android-sdk.git'
}
}
}
}
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/"))
}
}
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId 'io.lbry'
artifactId 'lbrysdk32'
version {{ args.version }}
if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
from components.java
}
artifact androidSourcesJar
artifact javadocJar
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'
distribution 'repo'
name = 'MIT License'
url = 'https://raw.githubusercontent.com/lbryio/lbry-android-sdk/master/LICENSE'
}
}
developers {
developer {
id 'shockr'
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'
}
}
}
}
}
}
nexus {
sign = true
repositoryUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
snapshotRepositoryUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
signing {
sign publishing.publications
}
dependencies {

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"] }}