Skip to content

Commit

Permalink
Add binary upload logic
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusja committed Mar 21, 2016
1 parent a8e824c commit 99ebf1e
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
60 changes: 60 additions & 0 deletions libaums/bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apply plugin: 'com.jfrog.bintray'

version = libraryVersion

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))
classpath += configurations.javadocDeps
}
} 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
}

// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password")
//Optional. The passphrase for GPG signing'
}
}
}
}
33 changes: 33 additions & 0 deletions libaums/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
apply plugin: 'com.android.library'

configurations {
javadocDeps
}

ext {
bintrayRepo = 'maven'
bintrayName = 'libaums'

publishedGroupId = 'com.github.mjdev'
libraryName = 'libaums'
artifact = 'libaums'

libraryDescription = 'Android USB mass storage library with FAT32 support.'

siteUrl = 'https://github.com/mjdev/libaums'
gitUrl = 'https://github.com/mjdev/libaums.git'

libraryVersion = '0.3-SNAPSHOT'

developerId = 'mjdev'
developerName = 'mjahnen'
developerEmail = 'jahnen@in.tum.de'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
Expand All @@ -24,7 +52,12 @@ android {

dependencies {
compile 'com.nanohttpd:nanohttpd-webserver:2.2.0'
javadocDeps 'com.nanohttpd:nanohttpd-webserver:2.2.0'

testCompile 'junit:junit:4.12'
compile 'com.android.support:support-annotations:23.1.1'
javadocDeps 'com.android.support:support-annotations:23.1.1'
}

apply from: 'install.gradle'
apply from: 'bintray.gradle'
43 changes: 43 additions & 0 deletions libaums/install.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apply plugin: 'com.github.dcendents.android-maven'

group = publishedGroupId // Maven Group ID for the artifact

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
version libraryVersion

// Add your description here
name libraryName
description libraryDescription
url siteUrl

// Set your license
licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl

}
}
}
}
}

0 comments on commit 99ebf1e

Please sign in to comment.