Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use Gradle Nexus Publish Plugin #788

Merged
merged 15 commits into from
Sep 25, 2023
6 changes: 3 additions & 3 deletions .github/actions/close_and_release_repository/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ inputs:
runs:
using: "composite"
steps:
- run: ./gradlew --stacktrace closeAndReleaseRepository
- run: ./gradlew --stacktrace closeAndReleaseSonatypeStagingRepository
shell: bash
env:
SONATYPE_USERNAME: ${{ inputs.sonatype_usr }}
SONATYPE_PASSWORD: ${{ inputs.sonatype_pwd }}
SONATYPE_NEXUS_USERNAME: ${{ inputs.sonatype_usr }}
SONATYPE_NEXUS_PASSWORD: ${{ inputs.sonatype_pwd }}
SIGNING_KEY_ID: ${{ inputs.signing_key_id }}
SIGNING_KEY_PASSWORD: ${{ inputs.signing_key_pwd }}
SIGNING_KEY_FILE: ${{ inputs.signing_key_file }}
4 changes: 2 additions & 2 deletions .github/actions/publish_all_modules/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ runs:
:PayPalNativeCheckout:publishToSonatype
shell: bash
env:
SONATYPE_USERNAME: ${{ inputs.sonatype_usr }}
SONATYPE_PASSWORD: ${{ inputs.sonatype_pwd }}
SONATYPE_NEXUS_USERNAME: ${{ inputs.sonatype_usr }}
SONATYPE_NEXUS_PASSWORD: ${{ inputs.sonatype_pwd }}
SIGNING_KEY_ID: ${{ inputs.signing_key_id }}
SIGNING_KEY_PASSWORD: ${{ inputs.signing_key_pwd }}
SIGNING_KEY_FILE: ${{ inputs.signing_key_file }}
71 changes: 6 additions & 65 deletions AmericanExpress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jetbrains.dokka'
id 'de.marcphilipp.nexus-publish'
id 'signing'
}

android {
Expand Down Expand Up @@ -44,69 +42,12 @@ dependencies {

// region signing and publishing

task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

signing {
required {
!version.endsWith("SNAPSHOT") && !version.endsWith("DEVELOPMENT")
}
sign publishing.publications
}

nexusPublishing {
// give nexus sonatype more time to initialize the staging repository
clientTimeout = Duration.ofMinutes(3)
useStaging = !rootProject.versionName.endsWith("SNAPSHOT")
repositories {
sonatype()
}
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

artifact sourcesJar
project.ext.name = "american-express"
project.ext.pom_name = "american-express"
project.ext.group_id = "com.braintreepayments.api"
project.ext.version = rootProject.version
project.ext.pom_desc = "American Express dependencies for Braintree Android."

groupId = 'com.braintreepayments.api'
artifactId = 'american-express'
version = rootProject.versionName

pom {
name = 'american-express'
packaging = 'aar'
description = 'American Express dependencies for Braintree Android.'
url = 'https://github.com/braintree/braintree_android'

scm {
url = 'scm:[email protected]:braintree/braintree_android.git'
connection = 'scm:[email protected]:braintree/braintree_android.git'
developerConnection = 'scm:[email protected]:braintree/braintree_android.git'
}

developers {
developer {
id = 'devs'
name = 'Braintree Payments'
}
}

licenses {
license {
name = 'MIT'
url = 'http://opensource.org/licenses/MIT'
distribution = 'repo'
}
}
}
}
}
}
}
apply from: rootProject.file("gradle/gradle-publish.gradle")

// endregion
71 changes: 6 additions & 65 deletions BraintreeCore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jetbrains.dokka'
id 'de.marcphilipp.nexus-publish'
id 'signing'
id 'kotlin-kapt'
}

Expand Down Expand Up @@ -108,69 +106,12 @@ gradle.taskGraph.whenReady { taskGraph ->

// region signing and publishing

task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

signing {
required {
!version.endsWith("SNAPSHOT") && !version.endsWith("DEVELOPMENT")
}
sign publishing.publications
}
project.ext.name = "braintree-core"
project.ext.pom_name = "braintree-core"
project.ext.group_id = "com.braintreepayments.api"
project.ext.version = rootProject.version
project.ext.pom_desc = "This is Braintree\'s Android SDK. Integrate this library to accept payments in your Android app."

nexusPublishing {
// give nexus sonatype more time to initialize the staging repository
clientTimeout = Duration.ofMinutes(3)
useStaging = !rootProject.versionName.endsWith("SNAPSHOT")
repositories {
sonatype()
}
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

artifact sourcesJar

groupId = 'com.braintreepayments.api'
artifactId = 'braintree-core'
version = rootProject.versionName

pom {
name = 'braintree-core'
packaging = 'aar'
description = 'This is Braintree\'s Android SDK. Integrate this library to accept payments in your Android app.'
url = 'https://github.com/braintree/braintree_android'

scm {
url = 'scm:[email protected]:braintree/braintree_android.git'
connection = 'scm:[email protected]:braintree/braintree_android.git'
developerConnection = 'scm:[email protected]:braintree/braintree_android.git'
}

developers {
developer {
id = 'devs'
name = 'Braintree Payments'
}
}

licenses {
license {
name = 'MIT'
url = 'http://opensource.org/licenses/MIT'
distribution = 'repo'
}
}
}
}
}
}
}
apply from: rootProject.file("gradle/gradle-publish.gradle")

// endregion
71 changes: 6 additions & 65 deletions BraintreeDataCollector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jetbrains.dokka'
id 'de.marcphilipp.nexus-publish'
id 'signing'
}

android {
Expand Down Expand Up @@ -59,70 +57,13 @@ dependencies {

// region signing and publishing

task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

signing {
required {
!version.endsWith("SNAPSHOT") && !version.endsWith("DEVELOPMENT")
}
sign publishing.publications
}

nexusPublishing {
// give nexus sonatype more time to initialize the staging repository
clientTimeout = Duration.ofMinutes(3)
useStaging = !rootProject.versionName.endsWith("SNAPSHOT")
repositories {
sonatype()
}
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

artifact sourcesJar
project.ext.name = "data-collector"
project.ext.pom_name = "data-collector"
project.ext.group_id = "com.braintreepayments.api"
project.ext.version = rootProject.version
project.ext.pom_desc = "Fraud tools for Braintree integrations on Android."

groupId = 'com.braintreepayments.api'
artifactId = 'data-collector'
version = rootProject.versionName

pom {
name = 'data-collector'
packaging = 'aar'
description = 'Fraud tools for Braintree integrations on Android.'
url = 'https://github.com/braintree/braintree_android'

scm {
url = 'scm:[email protected]:braintree/braintree_android.git'
connection = 'scm:[email protected]:braintree/braintree_android.git'
developerConnection = 'scm:[email protected]:braintree/braintree_android.git'
}

developers {
developer {
id = 'devs'
name = 'Braintree Payments'
}
}

licenses {
license {
name = 'MIT'
url = 'http://opensource.org/licenses/MIT'
distribution = 'repo'
}
}
}
}
}
}
}
apply from: rootProject.file("gradle/gradle-publish.gradle")

// endregion

71 changes: 6 additions & 65 deletions Card/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jetbrains.dokka'
id 'de.marcphilipp.nexus-publish'
id 'signing'
}

android {
Expand Down Expand Up @@ -53,69 +51,12 @@ dependencies {

// region signing and publishing

task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

signing {
required {
!version.endsWith("SNAPSHOT") && !version.endsWith("DEVELOPMENT")
}
sign publishing.publications
}

nexusPublishing {
// give nexus sonatype more time to initialize the staging repository
clientTimeout = Duration.ofMinutes(3)
useStaging = !rootProject.versionName.endsWith("SNAPSHOT")
repositories {
sonatype()
}
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

artifact sourcesJar
project.ext.name = "card"
project.ext.pom_name = "card"
project.ext.group_id = "com.braintreepayments.api"
project.ext.version = rootProject.version
project.ext.pom_desc = "Card dependencies for Braintree Android."

groupId = 'com.braintreepayments.api'
artifactId = 'card'
version = rootProject.versionName

pom {
name = 'card'
packaging = 'aar'
description = 'Card dependencies for Braintree Android.'
url = 'https://github.com/braintree/braintree_android'

scm {
url = 'scm:[email protected]:braintree/braintree_android.git'
connection = 'scm:[email protected]:braintree/braintree_android.git'
developerConnection = 'scm:[email protected]:braintree/braintree_android.git'
}

developers {
developer {
id = 'devs'
name = 'Braintree Payments'
}
}

licenses {
license {
name = 'MIT'
url = 'http://opensource.org/licenses/MIT'
distribution = 'repo'
}
}
}
}
}
}
}
apply from: rootProject.file("gradle/gradle-publish.gradle")

// endregion
Loading