-
Notifications
You must be signed in to change notification settings - Fork 18
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 (#70)
* Update publish plugin
- Loading branch information
Showing
6 changed files
with
103 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'maven-publish' | ||
id 'signing' | ||
} | ||
|
||
android { | ||
|
@@ -40,73 +38,13 @@ 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") | ||
} | ||
sign publishing.publications | ||
} | ||
|
||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
afterEvaluate { | ||
from components.release | ||
} | ||
project.ext.name = "browser-switch" | ||
project.ext.pom_name = "browser-switch" | ||
project.ext.group_id = "com.braintreepayments.api" | ||
project.ext.version = rootProject.version | ||
project.ext.pom_desc = "Android Browser Switch makes it easy to open a url in a browser or Chrome Custom Tab and receive a response as the result of user interaction, either cancel or response data from the web page." | ||
|
||
groupId = 'com.braintreepayments.api' | ||
artifactId = 'browser-switch' | ||
version = rootProject.versionName | ||
|
||
artifact sourcesJar | ||
artifact javadocsJar | ||
|
||
pom { | ||
name = 'browser-switch' | ||
packaging = 'aar' | ||
description = 'Android Browser Switch makes it easy to open a url in a browser or Chrome Custom Tab and receive a response as the result of user interaction, either cancel or response data from the web page.' | ||
url = 'https://github.com/braintree/browser-switch-android' | ||
|
||
scm { | ||
url = 'scm:[email protected]:braintree/browser-switch-android.git' | ||
connection = 'scm:[email protected]:braintree/browser-switch-android.git' | ||
developerConnection = 'scm:[email protected]:braintree/browser-switch-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 | ||
|
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 |
---|---|---|
|
@@ -2,3 +2,19 @@ android.useAndroidX=true | |
|
||
# Ref: https://stackoverflow.com/a/50673210 | ||
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
POM_PACKAGING=aar | ||
|
||
POM_URL=https://github.com/braintree/browser-switch-android | ||
|
||
POM_SCM_URL=scm:[email protected]:braintree/browser-switch-android.git | ||
POM_SCM_CONNECTION=scm:[email protected]:braintree/browser-switch-android.git | ||
POM_SCM_DEV_CONNECTION=scm:[email protected]:braintree/browser-switch-android.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 | ||
} |