From bcdc6509e53832ab9c4c91d7e9e0fda903dfa8db Mon Sep 17 00:00:00 2001 From: bowyer-app Date: Fri, 7 Aug 2015 00:47:06 +0900 Subject: [PATCH] add binary upload setting --- LICENSE.txt | 3 + build.gradle | 3 +- fabtransitionlayout/bintray-publish.gradle | 102 +++++++++++++++++++++ fabtransitionlayout/build.gradle | 1 + gradle.properties | 20 +++- 5 files changed, 126 insertions(+), 3 deletions(-) create mode 100644 LICENSE.txt create mode 100644 fabtransitionlayout/bintray-publish.gradle diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..f427740 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,3 @@ +Copyright (c) 2015 Bowyer +Released under the MIT license +http://opensource.org/licenses/mit-license.php \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9405f3f..88eed80 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' - + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' + classpath 'com.github.dcendents:android-maven-plugin:1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/fabtransitionlayout/bintray-publish.gradle b/fabtransitionlayout/bintray-publish.gradle new file mode 100644 index 0000000..d1115ed --- /dev/null +++ b/fabtransitionlayout/bintray-publish.gradle @@ -0,0 +1,102 @@ +apply plugin: 'maven-publish' +apply plugin: 'com.jfrog.bintray' + +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar, javadocJar +} + +def getBintrayUser() { + return hasProperty('BINTRAY_USER') ? BINTRAY_USER : "" +} + +def getBintrayApiKey() { + return hasProperty('BINTRAY_APIKEY') ? BINTRAY_APIKEY : "" +} + +def getGpgPassphrase() { + return hasProperty('BINTRAY_GPG_PASSPHRASE') ? BINTRAY_GPG_PASSPHRASE : "" +} + +publishing { + publications { + mavenJava(MavenPublication) { + groupId GROUP + version VERSION_NAME + artifactId ARTIFACT_ID + artifact "build/outputs/aar/fabtransitionlayout-release.aar" + artifact javadocJar + artifact sourcesJar + pom.withXml { + Node root = asNode() + root.appendNode('name', ARTIFACT_ID) + root.appendNode('description', POM_DESCRIPTION) + root.appendNode('url', POM_URL) + + def issues = root.appendNode('issueManagement') + issues.appendNode('system', 'github') + issues.appendNode('url', ISSUE_URL) + + def scm = root.appendNode('scm') + scm.appendNode('url', POM_SCM_URL) + scm.appendNode('connection', POM_SCM_CONNECTION) + scm.appendNode('developerConnection', POM_SCM_DEV_CONNECTION) + + def license = root.appendNode('licenses').appendNode('license') + license.appendNode('name', POM_LICENCE_NAME) + license.appendNode('url', POM_LICENCE_URL) + license.appendNode('distribution', POM_LICENCE_DIST) + + def dependenciesNode = asNode().appendNode('dependencies') + configurations.compile.allDependencies.each { + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', it.group) + dependencyNode.appendNode('artifactId', it.name) + dependencyNode.appendNode('version', it.version) + dependencyNode.appendNode('scope', 'compile') + } + } + } + } +} + +bintray { + user = bintrayUser + key = bintrayApiKey + + publications = ['mavenJava'] + + dryRun = false + publish = true + + pkg { + repo = "maven" + name = ARTIFACT_NAME + desc = POM_DESCRIPTION + websiteUrl = POM_URL + issueTrackerUrl = ISSUE_URL + vcsUrl = POM_SCM_URL + licenses = ["MIT"] + labels = ['android'] + publicDownloadNumbers = true + + version { + name = VERSION_NAME + vcsTag = VERSION_NAME + } + } +} \ No newline at end of file diff --git a/fabtransitionlayout/build.gradle b/fabtransitionlayout/build.gradle index 8865655..35d0cd6 100644 --- a/fabtransitionlayout/build.gradle +++ b/fabtransitionlayout/build.gradle @@ -22,3 +22,4 @@ dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.1' } +apply from: 'bintray-publish.gradle' diff --git a/gradle.properties b/gradle.properties index 82a39d2..7a1f2e2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,9 +16,25 @@ # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -VERSION_NAME=1.0.0 +VERSION_NAME=0.1.0 VERSION_CODE=1 COMPILE_SDK_VERSION=22 BUILD_TOOLS_VERSION=22.0.1 TARGET_SDK_VERSION=22 -MIN_SDK_VERSION=15 \ No newline at end of file +MIN_SDK_VERSION=15 + +GROUP=com.bowyer.app +ARTIFACT_ID=fabtransitionlayout +ARTIFACT_NAME=FabTransitionLayout + +POM_DESCRIPTION=Fab Transition Layout +POM_URL=https://github.com/bowyer-app/FabTransitionLayout +POM_SCM_URL=https://github.com/bowyer-app/FabTransitionLayout.git +POM_SCM_CONNECTION=https://github.com/bowyer-app/FabTransitionLayout.git +POM_SCM_DEV_CONNECTION=https://github.com/bowyer-app/FabTransitionLayout.git +POM_LICENCE_NAME=Released under the MIT license +POM_LICENCE_URL=http://opensource.org/licenses/mit-license.php +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=bowyer-app +POM_DEVELOPER_NAME=bowyer-app +ISSUE_URL=https://github.com/bowyer-app/FabTransitionLayout/issues