diff --git a/build.gradle b/build.gradle index 9405f3f..47c3742 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,11 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.2.3' + classpath 'com.android.tools.build:gradle:1.3.0' + classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2" + // The following dependency has been replaced with newer version according to https://github.com/dcendents/android-maven-plugin + // classpath 'com.github.dcendents:android-maven-plugin:1.2' + 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/dfu/build.gradle b/dfu/build.gradle index 5296baa..0488dbc 100644 --- a/dfu/build.gradle +++ b/dfu/build.gradle @@ -1,10 +1,43 @@ apply plugin: 'com.android.library' -//ext { -// PUBLISH_GROUP_ID = 'no.nordicsemi.android' -// PUBLISH_ARTIFACT_ID = 'dfu-library' -// PUBLISH_VERSION = '0.6.0' -//} +/* + * I followed this: + * http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en + * tutorial to publish the library on jcenter and Maven Central repositories. + * Some changes needed to be done. See below for details. + * + * A newer then described version of maven plugin dependency is required (see project's gradle.build). + */ + +apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'com.jfrog.bintray' + +ext { + PUBLISH_GROUP_ID = 'no.nordicsemi.android' + PUBLISH_ARTIFACT_ID = 'dfu' + PUBLISH_VERSION = '0.6' + + bintrayRepo = 'android' + bintrayName = 'dfu-library' + + publishedGroupId = PUBLISH_GROUP_ID + artifact = PUBLISH_ARTIFACT_ID + libraryVersion = PUBLISH_VERSION + libraryName = 'DFU Library' + libraryDescription = 'Device Firmware Update library' + + issuesUrl = 'https://github.com/NordicSemiconductor/Android-DFU-Library/issues' + siteUrl = 'https://github.com/NordicSemiconductor/Android-DFU-Library' + gitUrl = 'https://github.com/NordicSemiconductor/Android-DFU-Library.git' + + developerId = 'philips77' + developerName = 'Aleksander Nowakowski' + developerEmail = 'aleksander.nowakowski@nordicsemi.no' + + licenseName = 'The BSD 3-Clause License' + licenseUrl = 'http://opensource.org/licenses/BSD-3-Clause' + allLicenses = ["BSD 3-Clause"] +} android { compileSdkVersion 23 @@ -30,5 +63,45 @@ dependencies { compile 'com.google.code.gson:gson:2.3.1' } -// Generate maven package: gradlew clean build generateRelease -//apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle' \ No newline at end of file +// The following script creates a POM file required to publish on Maven Central +apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle' + +// This script creates sources and javadocs. Both are required to publish a library on jcenter and MC. +apply from: 'https://raw.githubusercontent.com/ArthurHub/release-android-library/master/android-release-aar.gradle' + +// The following link publishes the library to jcenter. It does not handle the userOrg, so it has been copied and modified below. +//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle' + +// Copied from https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle +version = libraryVersion + +// 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 + userOrg = properties.getProperty("bintray.userOrg") + desc = libraryDescription + websiteUrl = siteUrl + issueTrackerUrl = issuesUrl + 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/dfu/dfu.iml b/dfu/dfu.iml index 0d657a0..c11f948 100644 --- a/dfu/dfu.iml +++ b/dfu/dfu.iml @@ -1,5 +1,5 @@ - + @@ -37,13 +37,13 @@ - + - + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0c71e76..b9e39b9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Fri Oct 16 09:46:17 CEST 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip