-
-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
282 additions
and
214 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,144 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'com.github.dcendents.android-maven' | ||
apply plugin: "com.jfrog.bintray" | ||
|
||
@SuppressWarnings(["GroovyUnusedDeclaration", "GrMethodMayBeStatic"]) | ||
def isReleaseBuild() { | ||
return !VERSION_NAME.contains("SNAPSHOT") | ||
} | ||
|
||
@SuppressWarnings("GroovyUnusedDeclaration") | ||
def getRepositoryUsername() { | ||
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" | ||
} | ||
|
||
@SuppressWarnings("GroovyUnusedDeclaration") | ||
def getRepositoryPassword() { | ||
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" | ||
} | ||
|
||
if (JavaVersion.current().isJava8Compatible()) { | ||
allprojects { | ||
tasks.withType(Javadoc) { | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
} | ||
} | ||
} | ||
|
||
task androidJavadocs(type: Javadoc) { | ||
failOnError = false | ||
source = android.sourceSets.main.java.source | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
} | ||
|
||
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { | ||
classifier = 'javadoc' | ||
from androidJavadocs.destinationDir | ||
} | ||
|
||
task androidSourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.source | ||
} | ||
|
||
bintray { | ||
dryRun = false | ||
publish = true | ||
override = true | ||
user = project.hasProperty('bintray.user') ? project.property('bintray.user') : System.getenv('BINTRAY_USER') | ||
key = project.hasProperty('bintray.apikey') ? project.property('bintray.apikey') : System.getenv('BINTRAY_API_KEY') | ||
def gpgkey = project.hasProperty('bintray.gpg.key') ? project.property('bintray.gpg.key') : System.getenv('BINTRAY_GPG_KEY') | ||
def gpgpass = project.hasProperty('bintray.gpg.password') ? project.property('bintray.gpg.password') : System.getenv('BINTRAY_GPG_PASS') | ||
|
||
publications('release') | ||
//configurations = ['archives'] // TODO figure out javadoc upload again. | ||
|
||
pkg { | ||
publish = true | ||
|
||
repo = "maven" | ||
name = POM_ARTIFACT_ID | ||
desc = POM_DESCRIPTION | ||
|
||
websiteUrl = POM_URL | ||
issueTrackerUrl = POM_SCM_URL_ISSUES | ||
vcsUrl = POM_SCM_URL | ||
|
||
githubRepo = POM_GITHUB_REPO | ||
githubReleaseNotesFile = POM_GITHUB_README | ||
|
||
publicDownloadNumbers = true | ||
licenses = ["Apache-2.0"] | ||
version { | ||
name = VERSION_NAME | ||
vcsTag = VERSION_NAME | ||
released = new Date() | ||
|
||
mavenCentralSync { | ||
sync = false | ||
user = getRepositoryUsername() //OSS user token | ||
password = getRepositoryPassword() //OSS user password | ||
close = '1' | ||
} | ||
gpg { | ||
sign = true //Determines whether to GPG sign the files. The default is false | ||
passphrase = gpgpass //Optional. The passphrase for GPG signing' | ||
} | ||
} | ||
} | ||
} | ||
|
||
ext.addDependency = { dependencyNode, group, name, version -> | ||
dependencyNode.appendNode('groupId', group) | ||
dependencyNode.appendNode('artifactId', name) | ||
dependencyNode.appendNode('version', version) | ||
//dependencyNode.appendNode('type', "aar") | ||
dependencyNode.appendNode('scope', "compile") | ||
} | ||
|
||
def pomConfig = { | ||
licenses { | ||
license { | ||
name POM_LICENCE_NAME | ||
url POM_LICENCE_URL | ||
distribution POM_LICENCE_DIST | ||
} | ||
} | ||
developers { | ||
developer { | ||
id POM_DEVELOPER_ID | ||
name POM_DEVELOPER_NAME | ||
email '[email protected]' | ||
} | ||
} | ||
scm { | ||
url POM_SCM_URL | ||
connection POM_SCM_CONNECTION | ||
developerConnection POM_SCM_DEV_CONNECTION | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
pom.withXml { | ||
asNode().appendNode('name', POM_NAME); | ||
asNode().appendNode('description', POM_DESCRIPTION); | ||
asNode().appendNode('url', POM_SCM_URL); | ||
def dependenciesNode = asNode().appendNode('dependencies'); | ||
configurations.implementation.allDependencies.each { | ||
// Ensure dependencies such as fileTree are not included. | ||
if (it.name != 'unspecified') { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
if (it.version != "unspecified") { | ||
addDependency(dependencyNode, it.group, it.name, it.version) | ||
} else { | ||
addDependency(dependencyNode, it.getDependencyProject().findProperty("GROUP"), it.getDependencyProject().findProperty("POM_ARTIFACT_ID"), it.getDependencyProject().findProperty("VERSION_NAME")) | ||
} | ||
} | ||
} | ||
asNode().children().last() + pomConfig | ||
} | ||
} | ||
} | ||
} |
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,13 +1,19 @@ | ||
# Maven stuff | ||
GROUP=com.mikepenz | ||
|
||
POM_DESCRIPTION=FastAdapter Library | ||
POM_URL=https://github.com/mikepenz/FastAdapter | ||
|
||
POM_SCM_URL=https://github.com/mikepenz/FastAdapter | ||
POM_SCM_CONNECTION=scm:[email protected]:mikepenz/FastAdapter.git | ||
POM_SCM_DEV_CONNECTION=scm:[email protected]:mikepenz/FastAdapter.git | ||
POM_SCM_URL_ISSUES=https://github.com/mikepenz/FastAdapter/issues | ||
|
||
POM_GITHUB_REPO=mikepenz/FastAdapter | ||
POM_GITHUB_README=README.md | ||
|
||
POM_LICENCE_NAME=The Apache Software License, Version 2.0 | ||
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt | ||
POM_LICENCE_DIST=repo | ||
|
||
POM_DEVELOPER_ID=mikepenz | ||
POM_DEVELOPER_NAME=Mike Penz |
Oops, something went wrong.