Skip to content

Commit

Permalink
add binary upload setting
Browse files Browse the repository at this point in the history
  • Loading branch information
bowyer-app committed Aug 6, 2015
1 parent 87cb552 commit bcdc650
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 3 deletions.
3 changes: 3 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Copyright (c) 2015 Bowyer
Released under the MIT license
http://opensource.org/licenses/mit-license.php
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
102 changes: 102 additions & 0 deletions fabtransitionlayout/bintray-publish.gradle
Original file line number Diff line number Diff line change
@@ -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
}
}
}
1 change: 1 addition & 0 deletions fabtransitionlayout/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
20 changes: 18 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit bcdc650

Please sign in to comment.