Skip to content

Commit

Permalink
Merge branch '50-bintray-is-being-discontinued' into 'master'
Browse files Browse the repository at this point in the history
Resolve "Bintray is being discontinued"

Closes #50

See merge request pace/mobile/android/pace-cloud-sdk!57
  • Loading branch information
Martin Dinh committed Mar 11, 2021
2 parents fecfd5a + 8edd870 commit d3e6e90
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 62 deletions.
27 changes: 18 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,27 @@ documentation:
only:
- tags
artifacts:
paths:
- ./*.zip
name: "android-pace-cloud-sdk-$BUILD_VERSION_NAME.zip"
expire_in: 1 week
paths:
- ./*.zip
name: "android-pace-cloud-sdk-$BUILD_VERSION_NAME.zip"
expire_in: 1 week

bintray_upload:
maven_central_upload:
extends: .android_version
stage: build
script:
- ./gradlew bintrayUpload -Puser=$BINTRAY_USER -Pkey=$BINTRAY_KEY -PbuildNumber=$BUILD_NUMBER -PversionName=$BUILD_VERSION_NAME
- bash -c "echo '$SIGNING_GPG_KEY_CONTENT' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
- ./gradlew clean library:assembleRelease
- ./gradlew sourcesJar javadocJar
- ./gradlew publishReleasePublicationToMavenCentralRepository --max-workers 1 -PbuildNumber=$BUILD_NUMBER -PversionName=$BUILD_VERSION_NAME -PsigningKeyId=$SIGNING_KEY_ID -PsigningPassword=$SIGNING_PASSWORD -PsigningSecretKeyRingFile=$SIGNING_SECRET_KEY_RING_FILE -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD
only:
- tags

maven_central_close_and_release:
extends: .android_version
stage: publish
script:
- ./gradlew closeAndReleaseRepository -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD -PsonatypeStagingProfileId=$SONATYPE_STAGING_PROFILE_ID
when: manual
only:
- tags
except:
variables:
- $CI_COMMIT_TAG !~ /^pacecloudsdk-/
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ x.y.z Release notes (yyyy-MM-dd)
<!-- ### Internal - Include, if needed -->


5.2.0 Release notes (2021-03-11)
=============================================================

### Enhancements

* Remove Bintray integration because it will be discontinued
* Add Maven Central and JitPack as alternative repositories (see the installation section in README)


5.1.1 Release notes (2021-03-08)
=============================================================

Expand Down
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# PACE Cloud SDK

[![License](https://img.shields.io/github/license/pace/cloud-sdk-android)](https://github.com/pace/cloud-sdk-android/blob/master/LICENSE.md)
[![Maven Central](https://img.shields.io/maven-central/v/cloud.pace/sdk)](https://search.maven.org/artifact/cloud.pace/sdk)
[![JitPack](https://img.shields.io/jitpack/v/github/pace/cloud-sdk-android)](https://jitpack.io/#pace/cloud-sdk-android)

This framework combines multipe functionalities provided by PACE i.e. authorizing via **PACE ID** or requesting and displaying **Apps**. These functionalities are separated and structured into different ***Kits*** by namespaces, i.e. [IDKit](#idkit), [AppKit](#appkit).

- [PACE Cloud SDK](#pace-cloud-sdk)
* [Specifications](#specifications)
* [Installation](#installation)
+ [Maven Central](#maven-central)
+ [JitPack](#jitpack)
* [Setup](#setup)
* [Migration](#migration)
+ [2.x.x -> 3.x.x](#from-2xx-to-3xx)
Expand Down Expand Up @@ -33,27 +39,49 @@ This framework combines multipe functionalities provided by PACE i.e. authorizin
+ [Miscellaneous](#miscellaneous)

## Specifications
**PACECloudSDK** currently supports Android 6.0 (API level 23) and above.
`PACECloudSDK` currently supports Android 6.0 (API level 23) and above.

## Installation
Add JCenter to your top-level `build.gradle` (if not yet):
You can get the `PACECloudSDK` from **one** of the following repositories.

### Maven Central
Add Maven Central to your top-level `build.gradle` (if not yet):
```groovy
allprojects {
repositories {
...
jcenter()
mavenCentral()
}
}
```

Add the **PACE Cloud SDK** dependency to your module's `build.gradle`:
Add the `PACECloudSDK` dependency to your module's `build.gradle`:
```groovy
dependencies {
...
implementation "cloud.pace:sdk:$pace_cloud_sdk_version"
}
```

### JitPack
Add JitPack to your top-level `build.gradle` (if not yet):
```groovy
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```

Add the `PACECloudSDK` dependency to your module's `build.gradle`:
```groovy
dependencies {
...
implementation "com.github.pace:cloud-sdk-android:$pace_cloud_sdk_version"
}
```

## Setup
The `PACECloudSDK` needs to be setup before any of its `Kits` can be used. Therefore you *must* call `PACECloudSDK.setup(context: Context, configuration: Configuration)`. The best way to do this is inside your `Application` class. It will automatically authorize your application with the provided api key.

Expand Down
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'io.codearte.nexus-staging'

buildscript {
ext {
compile_sdk_version = 30
min_sdk_version = 23
target_sdk_version = 30
build_number = properties.getOrDefault("buildNumber", 1) as Integer
version_name = properties.getOrDefault("versionName", "5.1.1")
version_name = properties.getOrDefault("versionName", "5.2.0")

group_id = "cloud.pace"
artifact_id = "sdk"
user = properties.get("user")
key = properties.get("key")

gradle_version = "4.0.2"
kotlin_version = "1.4.10"
bintray_version = "1.8.5"
nexus_staging_version = "0.30.0"
dokka_version = "1.4.20"
coroutines_version = "1.4.1"
core_ktx_version = "1.3.2"
Expand Down Expand Up @@ -58,7 +58,7 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:$gradle_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version"
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:$nexus_staging_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -69,6 +69,7 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven { url "https://repo.dev.k8s.pacelink.net/maven/" }
mavenLocal()
Expand Down
161 changes: 117 additions & 44 deletions library/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply plugin: 'signing'

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
Expand All @@ -22,65 +22,138 @@ artifacts {
archives javadocJar
}

def pomConfig = {
licenses {
license {
name "The MIT License (MIT)"
url "https://opensource.org/licenses/MIT"
distribution "repo"
}
}
}

configurations {
javadocDeps
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId = rootProject.ext.group_id
artifactId = rootProject.ext.artifact_id
version = rootProject.ext.version_name
group = rootProject.ext.group_id
version = rootProject.ext.version_name

ext["signing.keyId"] = properties.get("signingKeyId")
ext["signing.password"] = properties.get("signingPassword")
ext["signing.secretKeyRingFile"] = properties.get("signingSecretKeyRingFile")
ext["ossrhUsername"] = properties.get("ossrhUsername")
ext["ossrhPassword"] = properties.get("ossrhPassword")
ext["sonatypeStagingProfileId"] = properties.get("sonatypeStagingProfileId")

from components.release
publishing {
publications {
debug(MavenPublication) {
groupId rootProject.ext.group_id
artifactId rootProject.ext.artifact_id
version rootProject.ext.version_name

artifact("$buildDir/outputs/aar/${project.getName()}-debug.aar")
artifact sourcesJar
artifact javadocJar

pom {
name = 'PACE Cloud SDK Android'
description = 'PACE Cloud SDK is a client SDK that allows your app to easily connect to PACE\'s Connected Fueling. The SDK consists of the IDKit to manage the OpenID (OID) authorization and general session flow with its token handling. It also consists of the AppKit, with which you can fetch and display location based apps, apps by URL or ID. Furthermore it contains the POIKit, which allows you to fetch Point of Interests (e.g. gas stations), request routes and search for locations.'
url = 'https://github.com/pace/cloud-sdk-android'
licenses {
license {
name = 'The MIT License (MIT)'
url = 'https://github.com/pace/cloud-sdk-android/blob/master/LICENSE.md'
}
}
developers {
developer {
name = 'PACE Telematics GmbH'
email = 'android-dev@pace.car'
organization = 'PACE Telematics GmbH'
organizationUrl = 'https://www.pace.car'
}
}
scm {
connection = 'scm:git:github.com/pace/cloud-sdk-android.git'
developerConnection = 'scm:git:ssh://github.com/pace/cloud-sdk-android.git'
url = 'https://github.com/pace/cloud-sdk-android/tree/master'
}
withXml {
def dependenciesNode = asNode().appendNode('dependencies')

artifact sourcesJar {
classifier "sources"
project.configurations.implementation.allDependencies.each {
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
release(MavenPublication) {
groupId rootProject.ext.group_id
artifactId rootProject.ext.artifact_id
version rootProject.ext.version_name

artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
artifact sourcesJar
artifact javadocJar

artifact javadocJar {
classifier "javadoc"
pom {
name = 'PACE Cloud SDK Android'
description = 'PACE Cloud SDK is a client SDK that allows your app to easily connect to PACE\'s Connected Fueling. The SDK consists of the IDKit to manage the OpenID (OID) authorization and general session flow with its token handling. It also consists of the AppKit, with which you can fetch and display location based apps, apps by URL or ID. Furthermore it contains the POIKit, which allows you to fetch Point of Interests (e.g. gas stations), request routes and search for locations.'
url = 'https://github.com/pace/cloud-sdk-android'
licenses {
license {
name = 'The MIT License (MIT)'
url = 'https://github.com/pace/cloud-sdk-android/blob/master/LICENSE.md'
}
}
developers {
developer {
name = 'PACE Telematics GmbH'
email = 'android-dev@pace.car'
organization = 'PACE Telematics GmbH'
organizationUrl = 'https://www.pace.car'
}
}
scm {
connection = 'scm:git:github.com/pace/cloud-sdk-android.git'
developerConnection = 'scm:git:ssh://github.com/pace/cloud-sdk-android.git'
url = 'https://github.com/pace/cloud-sdk-android/tree/master'
}
withXml {
def dependenciesNode = asNode().appendNode('dependencies')

pom.withXml {
def root = asNode()
root.appendNode('name', 'PACE Cloud SDK')
root.appendNode('description', 'PACE Cloud SDK is a client SDK that allows your app to easily connect to PACE’s Connected Fueling. The SDK consists of the IDKit to manage the OpenID (OID) authorization and general session flow with its token handling. It also consists of the AppKit, with which you can fetch and display location based apps, apps by URL or ID. Furthermore it contains the POIKit, which allows you to fetch Point of Interests (e.g. gas stations), request routes and search for locations.')
root.appendNode('url', 'https://github.com/pace/cloud-sdk-android')
root.children().last() + pomConfig
project.configurations.implementation.allDependencies.each {
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
}
repositories {
maven {
name = "mavenCentral"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"

bintray {
user = rootProject.ext.user
key = rootProject.ext.key
publications = ['release']

pkg {
repo = rootProject.ext.group_id
name = rootProject.ext.artifact_id
version {
name = rootProject.ext.version_name
desc = "PACE Cloud SDK version $rootProject.ext.version_name"
released = new Date()
vcsTag = rootProject.ext.version_name
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}

nexusStaging {
serverUrl = "https://s01.oss.sonatype.org/service/local/"
packageGroup = rootProject.ext.group_id
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
}

publish = true
signing {
// Signing is only mandatory for release publications.
// Publish to mavenLocal can be executed with the publishDebugPublicationToMavenLocal Gradle task (unsigned).
sign publishing.publications.release
}

0 comments on commit d3e6e90

Please sign in to comment.