-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from btrautmann/develop
Kotlin support and updated publication strategy
- Loading branch information
Showing
18 changed files
with
363 additions
and
123 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 |
---|---|---|
@@ -0,0 +1,120 @@ | ||
apply plugin: 'com.jfrog.bintray' | ||
apply plugin: 'maven-publish' | ||
|
||
version = libraryVersion | ||
|
||
/* | ||
* Comment the following part if you only want to distribute .aar files. | ||
* (For example, your source code is obfuscated by Proguard and is not shown to outside developers) | ||
* Without source code .jar files, you only can publish on bintray repository but not jcenter. | ||
*/ | ||
|
||
if (project.hasProperty("android")) { | ||
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 | ||
} | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
artifacts { | ||
archives javadocJar | ||
archives sourcesJar | ||
} | ||
|
||
// Create the pom configuration: | ||
def pomConfig = { | ||
licenses { | ||
license { | ||
name "The Apache Software License, Version 2.0" | ||
url "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
distribution "repo" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id developerId | ||
name developerName | ||
email developerEmail | ||
} | ||
} | ||
|
||
scm { | ||
url "https://github.com/yourgithubaccount/example" | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
MyPublication(MavenPublication) { | ||
artifact sourcesJar | ||
artifact javadocJar | ||
groupId publishedGroupId | ||
artifactId artifact | ||
version libraryVersion | ||
pom.withXml { | ||
def root = asNode() | ||
root.appendNode('description', libraryDescription) | ||
root.appendNode('name', libraryName) | ||
root.appendNode('url', siteUrl) | ||
root.children().last() + pomConfig | ||
// Iterate over the implementation dependencies (we don't want the test ones), adding a <dependency> node for each | ||
def dependenciesNode = asNode() | ||
configurations.implementation.allDependencies.each { | ||
// Ensure dependencies such as fileTree are not included. | ||
if (it.name != 'unspecified') { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', it.group) | ||
dependencyNode.appendNode('artifactId', it.name) | ||
dependencyNode.appendNode('version', it.version) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Bintray | ||
Properties properties = new Properties() | ||
properties.load(project.rootProject.file('local.properties').newDataInputStream()) | ||
|
||
bintray { | ||
user = properties.getProperty("bintray.user") | ||
key = properties.getProperty("bintray.apikey") | ||
publications = ['MyPublication'] | ||
pkg { | ||
repo = bintrayRepo | ||
name = bintrayName | ||
desc = libraryDescription | ||
userOrg = organization | ||
// If the repository is hosted by an organization instead of personal account. | ||
websiteUrl = siteUrl | ||
vcsUrl = gitUrl | ||
licenses = allLicenses | ||
publish = true | ||
publicDownloadNumbers = true | ||
version { | ||
name = libraryVersionName | ||
desc = libraryDescription | ||
released = new Date() | ||
vcsTag = libraryVersion | ||
gpg { | ||
sign = true | ||
passphrase = properties.getProperty("bintray.gpg.password") | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ext { | ||
// Libraries | ||
supportLibraryVersion = '27.1.1' | ||
firebaseVersion = '16.0.0' | ||
junitVersion = '4.12' | ||
kotlinVersion = '1.2.41' | ||
rxJavaVersion = '2.1.8' | ||
|
||
// Build plugins | ||
androidPluginVersion = '3.1.2' | ||
bintrayPluginVersion = '1.8.0' | ||
mavenGradlePluginVersion = '2.1' | ||
|
||
// Build SDK versions | ||
minSdkVersion = 14 | ||
compileSdkVersion = 27 | ||
} |
File renamed without changes.
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,19 @@ | ||
ext { | ||
// Publishing | ||
libraryVersion = '1.0.2' | ||
libraryVersionName = '1.0.2' | ||
bintrayRepo = 'maven' | ||
publishedGroupId = 'com.oakwoodsc.rxfirestore' | ||
libraryDescription = 'An RxJava2 wrapper for Cloud Firestore' | ||
siteUrl = 'https://github.com/btrautmann/RxFirestore' | ||
gitUrl = 'https://github.com/btrautmann/RxFirestore.git' | ||
// Developer | ||
developerId = 'oakwoodsc' | ||
developerName = 'Oakwood Software Consulting, Inc.' | ||
developerEmail = '[email protected]' | ||
organization = 'oakwoodsc' // Correlates to URL | ||
// Licensing | ||
licenseName = 'The Apache Software License, Version 2.0' | ||
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
allLicenses = ["Apache-2.0"] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.