-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated with gradle tasks to upload to maven central
- Loading branch information
1 parent
2232b66
commit 5631ee2
Showing
3 changed files
with
95 additions
and
6 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 |
---|---|---|
|
@@ -26,7 +26,7 @@ ext { | |
developerEmail = '[email protected]' | ||
|
||
licenseName = 'MIT' | ||
licenseUrl = '' | ||
licenseUrl = 'https://opensource.org/licenses/MIT' | ||
allLicenses = ["MIT"] | ||
} | ||
|
||
|
@@ -141,5 +141,88 @@ publishing { | |
|
||
tasks.withType(Javadoc).all { enabled = false } | ||
|
||
apply from: 'https://raw.githubusercontent.com/xendit/xendit-sdk-android/master/installv1.gradle' | ||
apply from: 'https://raw.githubusercontent.com/xendit/xendit-sdk-android/master/bintrayv1.gradle' | ||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
|
||
if (project.hasProperty("android")) { // Android libraries | ||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.srcDirs | ||
} | ||
|
||
task javadoc(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
} | ||
} else { // Java libraries | ||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
} | ||
|
||
Properties properties = new Properties() | ||
properties.load(project.rootProject.file('local.properties').newDataInputStream()) | ||
String ossrhUser = properties.getProperty('ossrh.username') | ||
String ossrhPassword = properties.getProperty('ossrh.password') | ||
|
||
signing { | ||
sign configurations.archives | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
|
||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: ossrhUser, password: ossrhPassword) | ||
} | ||
|
||
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: ossrhUser, password: ossrhPassword) | ||
} | ||
|
||
pom.project { | ||
name bintrayName | ||
packaging 'aar' | ||
// optionally artifactId can be defined here | ||
description libraryDescription | ||
url siteUrl | ||
|
||
scm { | ||
connection gitUrl | ||
developerConnection gitUrl | ||
url gitUrl | ||
} | ||
|
||
licenses { | ||
license { | ||
name licenseName | ||
url licenseUrl | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id developerId | ||
name developerName | ||
email developerEmail | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
nexusStaging { | ||
serverUrl = 'https://s01.oss.sonatype.org/service/local/' | ||
username = ossrhUser | ||
password = ossrhPassword | ||
repositoryDescription = 'Closed and released using gradle script' | ||
} |