Skip to content

Commit

Permalink
Publication script updated
Browse files Browse the repository at this point in the history
  • Loading branch information
philips77 committed Jan 2, 2020
1 parent 34e6696 commit d1e9a8e
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 92 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Android BLE Library

[ ![Download](https://api.bintray.com/packages/nordic/android/ble-library/images/download.svg) ](https://bintray.com/nordic/android/ble-library/_latestVersion)
[ ![Download](https://api.bintray.com/packages/nordic/android/no.nordicsemi.android%3Able/images/download.svg) ](https://bintray.com/nordic/android/no.nordicsemi.android%3Able/_latestVersion)

An Android library that solves a lot of Android's Bluetooth Low Energy problems.
The [BleManager](https://github.com/NordicSemiconductor/Android-BLE-Library/blob/master/ble/src/main/java/no/nordicsemi/android/ble/BleManager.java)
Expand Down
85 changes: 2 additions & 83 deletions ble/build.gradle
Original file line number Diff line number Diff line change
@@ -1,43 +1,13 @@
apply plugin: 'com.android.library'
/*
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

ext {
PUBLISH_GROUP_ID = 'no.nordicsemi.android'
PUBLISH_ARTIFACT_ID = 'ble'
PUBLISH_VERSION = '2.1.1'
bintrayRepo = 'android'
bintrayName = 'ble-library'
publishedGroupId = PUBLISH_GROUP_ID
artifact = PUBLISH_ARTIFACT_ID
libraryVersion = PUBLISH_VERSION
libraryName = 'BLE Library'
libraryDescription = 'Bluetooth Low Energy library for Android'
issuesUrl = 'https://github.com/NordicSemiconductor/Android-BLE-Library/issues'
siteUrl = 'https://github.com/NordicSemiconductor/Android-BLE-Library'
gitUrl = 'https://github.com/NordicSemiconductor/Android-BLE-Library.git'
developerId = 'philips77'
developerName = 'Aleksander Nowakowski'
developerEmail = '[email protected]'
licenseName = 'The BSD 3-Clause License'
licenseUrl = 'http://opensource.org/licenses/BSD-3-Clause'
allLicenses = ["BSD 3-Clause"]
}
*/
android {
compileSdkVersion 29

defaultConfig {
minSdkVersion 18
targetSdkVersion 29
versionCode 27
versionName "2.1.1"
versionName VERSION_NAME

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -64,55 +34,4 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

/*
// 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'
}
}
}
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
*/
apply from: rootProject.file('gradle/gradle-bintray-push.gradle')
3 changes: 3 additions & 0 deletions ble/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=ble
POM_NAME=Bluetooth Low Energy library for Android
POM_PACKAGING=aar
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
/*
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
*/

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
19 changes: 15 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

android.enableJetifier=true
android.useAndroidX=true

# When configured, Gradle will run in incubating parallel mode.
# 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
android.useAndroidX=true

VERSION_NAME=2.2.0-alpha01
GROUP=no.nordicsemi.android

POM_DESCRIPTION=Bluetooth Low Energy library for Android
POM_URL=https://github.com/NordicSemiconductor/Android-BLE-Library
POM_SCM_URL=https://github.com/NordicSemiconductor/Android-BLE-Library
POM_SCM_CONNECTION=scm:[email protected]:NordicSemiconductor/Android-BLE-Library.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:NordicSemiconductor/Android-BLE-Library.git
POM_LICENCE=BSD 3-Clause
POM_LICENCE_NAME=The BSD 3-Clause License
POM_LICENCE_URL=http://opensource.org/licenses/BSD-3-Clause
POM_DEVELOPER_ID=nordic
POM_DEVELOPER_NAME=Nordic Semiconductor ASA
127 changes: 127 additions & 0 deletions gradle/gradle-bintray-push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
apply plugin: 'maven'
apply plugin: 'com.jfrog.bintray'

version = VERSION_NAME
group = GROUP

afterEvaluate { project ->
task install(type: Upload) {
repositories.mavenInstaller {
configuration = configurations.archives

pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME

pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL

scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}

licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
}
}

developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
}
}
}
}
}

task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles

title = POM_DESCRIPTION

options.links("https://docs.oracle.com/javase/8/docs/api/")
options.linksOffline("https://d.android.com/reference","${android.sdkDirectory}/docs/reference")

classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile

// We're excluding these generated files
exclude '**/BuildConfig.java'
exclude '**/R.java'
}

task androidJavadocsJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.source
}

if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
}

// 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 {
name = GROUP + ":" + POM_ARTIFACT_ID
desc = POM_DESCRIPTION

userOrg = properties.getProperty("BINTRAY_USER_ORG")
repo = properties.getProperty("BINTRAY_REPO")

websiteUrl = POM_URL
issueTrackerUrl = POM_URL + "/issues"
vcsUrl = POM_URL + ".git"

licenses = [POM_LICENCE]

publish = true
publicDownloadNumbers = true

version {
desc = POM_DESCRIPTION
vcsTag = "v" + VERSION_NAME
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'
}
// Optional configuration for Maven Central sync of the version
mavenCentralSync {
sync = true //[Default: true] Determines whether to sync the version to Maven Central.
user = properties.getProperty("SONATYPE_NEXUS_USERNAME") //OSS user token: mandatory
password = properties.getProperty("SONATYPE_NEXUS_PASSWORD") //OSS user password: mandatory
close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
}
}
}
}

0 comments on commit d1e9a8e

Please sign in to comment.