diff --git a/build.gradle b/build.gradle index e0b366a7..6055c477 100644 --- a/build.gradle +++ b/build.gradle @@ -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 } diff --git a/libaums/bintray.gradle b/libaums/bintray.gradle new file mode 100644 index 00000000..c2dd3cd0 --- /dev/null +++ b/libaums/bintray.gradle @@ -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' + } + } + } +} \ No newline at end of file diff --git a/libaums/build.gradle b/libaums/build.gradle index d78287fd..d2d84827 100644 --- a/libaums/build.gradle +++ b/libaums/build.gradle @@ -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" @@ -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' diff --git a/libaums/install.gradle b/libaums/install.gradle new file mode 100644 index 00000000..1943588c --- /dev/null +++ b/libaums/install.gradle @@ -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 + + } + } + } + } +} \ No newline at end of file