-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to use Gradle Nexus Publish Plugin (#442)
* Update gradle publish plugin
- Loading branch information
Showing
6 changed files
with
121 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'de.marcphilipp.nexus-publish' | ||
id 'signing' | ||
id 'kotlin-android' | ||
} | ||
|
||
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') ?: '' | ||
ext["signing.password"] = System.getenv('SIGNING_KEY_PASSWORD') ?: '' | ||
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_KEY_FILE') ?: '' | ||
|
||
def LOCALHOST_IP = System.properties['LOCALHOST_IP'] ?: '"10.0.2.2"'; | ||
def GATEWAY_IP = System.properties['GATEWAY_IP'] ?: '"10.0.2.2"'; | ||
def GATEWAY_PORT = System.properties['GATEWAY_PORT'] ?: '"3000"'; | ||
|
@@ -115,84 +109,16 @@ dependencies { | |
|
||
// region signing and publishing | ||
|
||
task javadocs(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
failOnError false | ||
} | ||
|
||
task javadocsJar(type: Jar, dependsOn: javadocs) { | ||
archiveClassifier.set('javadoc') | ||
from javadocs.destinationDir | ||
} | ||
|
||
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 | ||
artifact javadocsJar | ||
|
||
groupId = 'com.braintreepayments.api' | ||
artifactId = 'drop-in' | ||
version = rootProject.versionName | ||
|
||
pom { | ||
name = 'drop-in' | ||
packaging = 'aar' | ||
description = 'Drop-in payment form for Braintree\'s Android SDK. Integrate this library to add a readymade UI for your payments.' | ||
url = 'https://github.com/braintree/braintree-android-drop-in' | ||
|
||
scm { | ||
url = 'scm:[email protected]:braintree/braintree-android-drop-in.git' | ||
connection = 'scm:[email protected]:braintree/braintree-android-drop-in.git' | ||
developerConnection = 'scm:[email protected]:braintree/braintree-android-drop-in.git' | ||
} | ||
|
||
developers { | ||
developer { | ||
id = 'devs' | ||
name = 'Braintree Payments' | ||
} | ||
} | ||
|
||
licenses { | ||
license { | ||
name = 'MIT' | ||
url = 'http://opensource.org/licenses/MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
project.ext.name = "drop-in" | ||
project.ext.pom_name = "drop-in" | ||
project.ext.group_id = "com.braintreepayments.api" | ||
project.ext.version = rootProject.version | ||
project.ext.pom_desc = "Drop-in payment form for Braintree\'s Android SDK. Integrate this library to add a readymade UI for your payments." | ||
|
||
apply from: rootProject.file("gradle/gradle-publish.gradle") | ||
|
||
// endregion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,19 @@ | |
# We can remove this option after the following dependencies have AndrdoidX builds: | ||
# - com.google.android.gms:play-services-wallet | ||
android.useAndroidX=true | ||
|
||
POM_PACKAGING=aar | ||
|
||
POM_URL=https://github.com/braintree/braintree-android-drop-in | ||
|
||
POM_SCM_URL=scm:[email protected]:braintree/braintree-android-drop-in.git | ||
POM_SCM_CONNECTION=scm:[email protected]:braintree/braintree-android-drop-in.git | ||
POM_SCM_DEV_CONNECTION=scm:[email protected]:braintree/braintree-android-drop-in.git | ||
|
||
POM_LICENSE_NAME=MIT | ||
POM_LICENSE_URL=http://opensource.org/licenses/MIT | ||
POM_LICENSE_DISTRIBUTION=repo | ||
|
||
POM_DEVELOPER_ID=devs | ||
POM_DEVELOPER_NAME=Braintree Payments | ||
POM_DEVELOPER_EMAIL=[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
|
||
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') ?: '' | ||
ext["signing.password"] = System.getenv('SIGNING_KEY_PASSWORD') ?: '' | ||
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_KEY_FILE') ?: '' | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
groupId project.ext.group_id | ||
version project.ext.version | ||
artifactId project.ext.name | ||
from components.release | ||
artifact androidSourcesJar | ||
artifact javadocsJar | ||
|
||
pom { | ||
name = project.ext.pom_name ?: '' | ||
packaging = POM_PACKAGING | ||
description = project.ext.pom_desc ?: '' | ||
url = POM_URL | ||
licenses { | ||
license { | ||
name = POM_LICENSE_NAME | ||
url = POM_LICENSE_URL | ||
distribution = POM_LICENSE_DISTRIBUTION | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = POM_DEVELOPER_ID | ||
name = POM_DEVELOPER_NAME | ||
email = POM_DEVELOPER_EMAIL | ||
} | ||
} | ||
scm { | ||
connection = POM_SCM_CONNECTION | ||
developerConnection = POM_SCM_DEV_CONNECTION | ||
url = POM_SCM_URL | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications | ||
sign configurations.archives | ||
} | ||
} | ||
|
||
task javadocs(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
failOnError false | ||
} | ||
|
||
task javadocsJar(type: Jar, dependsOn: javadocs) { | ||
archiveClassifier.set('javadoc') | ||
from javadocs.destinationDir | ||
} | ||
|
||
task androidSourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
from android.sourceSets.main.java.srcDirs | ||
from android.sourceSets.main.kotlin.srcDirs | ||
} | ||
|
||
artifacts { | ||
archives androidSourcesJar | ||
archives javadocsJar | ||
} |