Skip to content

Commit 1eda6fe

Browse files
committed
Setup JCenter repository
1 parent 2edef46 commit 1eda6fe

File tree

5 files changed

+99
-32
lines changed

5 files changed

+99
-32
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,14 @@ library_review:
4444
only:
4545
- merge_requests
4646

47-
upload_archives:
47+
bintray_upload:
4848
extends: .android_version
4949
stage: build
5050
script:
5151
- export TAG_COMMIT_TIME=$(git show -s --format=%ct $CI_COMMIT_SHA)
5252
- export BUILD_NUMBER=$(TZ=Etc/Utc date -j -f '%s' ${TAG_COMMIT_TIME} "+%Y%m%d%H")
5353
- export BUILD_VERSION_NAME=`echo $CI_COMMIT_TAG | cut -d '-' -f2`
54-
- ./gradlew clean uploadArchives -PbuildNumber=$BUILD_NUMBER -PversionName=$BUILD_VERSION_NAME
55-
- cd ./mavenBuilds/cloud/pace/sdk/$BUILD_VERSION_NAME
56-
- zip -r framework.zip ./*
57-
- 'curl --fail --http1.1 -H "authorization: $REPO_SERVER_API_SECRET" -F id=$REPO_SERVER_ARTIFACT_ID -F platform=android -F version=$BUILD_VERSION_NAME -F [email protected] -X POST $REPO_SERVER_API_URL'
54+
- ./gradlew bintrayUpload -Puser=$BINTRAY_USER -Pkey=$BINTRAY_KEY
5855
only:
5956
- tags
6057
except:

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# PACE Cloud SDK
22

3+
## Setup
4+
5+
Add JCenter to your top-level `build.gradle` (if not yet):
6+
7+
```groovy
8+
allprojects {
9+
repositories {
10+
...
11+
jcenter()
12+
}
13+
}
14+
```
15+
16+
Add the **PACE Cloud SDK** dependency to your module's `build.gradle`:
17+
18+
```groovy
19+
dependencies {
20+
...
21+
implementation "cloud.pace:sdk:$pace_cloud_sdk_version"
22+
}
23+
```
24+
325
Because the PACE Cloud SDK uses [AppAuth for Android](https://github.com/openid/AppAuth-Android) for the IDKit, the AppAuth redirect scheme must be registered in your app's `build.gradle` file:
426
```groovy
527
android {

build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ buildscript {
66
target_sdk_version = 30
77
build_number = properties.getOrDefault("buildNumber", 1) as Integer
88
version_name = properties.getOrDefault("versionName", "2.0")
9+
910
group_id = "cloud.pace"
10-
project_name = "sdk"
11+
artifact_id = "sdk"
12+
user = properties.get("user")
13+
key = properties.get("key")
1114

1215
pace_cloud_sdk_version = "2.0"
1316
cloudsdk_version = "99578622"
1417
gradle_version = "4.0.2"
1518
kotlin_version = "1.4.10"
19+
bintray_version = "1.8.5"
1620
coroutines_version = "1.4.1"
1721
core_ktx_version = "1.3.2"
1822
appcompat_version = "1.2.0"
@@ -45,7 +49,6 @@ buildscript {
4549
robolectric_version = "4.3"
4650
test_core_version = "1.3.0"
4751
test_junit_version = "1.1.2"
48-
apache_maven_wagon_version = "2.12"
4952
}
5053
repositories {
5154
google()
@@ -54,6 +57,7 @@ buildscript {
5457
dependencies {
5558
classpath "com.android.tools.build:gradle:$gradle_version"
5659
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
60+
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version"
5761

5862
// NOTE: Do not place your application dependencies here; they belong
5963
// in the individual module build.gradle files
@@ -65,6 +69,7 @@ allprojects {
6569
google()
6670
jcenter()
6771
maven { url "https://repo.dev.k8s.pacelink.net/maven/" }
72+
mavenLocal()
6873
}
6974
}
7075

library/build.gradle

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44
apply plugin: 'kotlin-kapt'
5-
apply plugin: 'maven'
5+
apply from: 'publish.gradle'
66

77
android {
88
compileSdkVersion rootProject.ext.compile_sdk_version
@@ -37,7 +37,7 @@ android {
3737
sourceCompatibility JavaVersion.VERSION_1_8
3838
targetCompatibility JavaVersion.VERSION_1_8
3939

40-
kotlinOptions.freeCompilerArgs += ['-module-name', "$group_id.$project_name"]
40+
kotlinOptions.freeCompilerArgs += ['-module-name', "$group_id.$artifact_id"]
4141
}
4242

4343
kotlinOptions {
@@ -116,26 +116,3 @@ dependencies {
116116
androidTestImplementation "androidx.test.ext:junit:$test_junit_version"
117117
api "androidx.room:room-testing:$room_version"
118118
}
119-
120-
group rootProject.ext.group_id
121-
version rootProject.ext.version_name
122-
123-
configurations {
124-
deployerJars
125-
}
126-
127-
dependencies {
128-
deployerJars "org.apache.maven.wagon:wagon-ftp:$apache_maven_wagon_version"
129-
}
130-
131-
uploadArchives {
132-
delete "$rootProject.projectDir/mavenBuilds/"
133-
repositories {
134-
mavenDeployer {
135-
configuration = configurations.deployerJars
136-
pom.groupId = rootProject.ext.group_id
137-
pom.artifactId = rootProject.ext.project_name
138-
repository(url: 'file://mavenBuilds')
139-
}
140-
}
141-
}

library/publish.gradle

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
apply plugin: 'com.jfrog.bintray'
2+
apply plugin: 'maven-publish'
3+
4+
task sourcesJar(type: Jar) {
5+
from android.sourceSets.main.java.srcDirs
6+
archiveClassifier.set('sources')
7+
}
8+
9+
artifacts {
10+
archives sourcesJar
11+
}
12+
13+
def pomConfig = {
14+
licenses {
15+
license {
16+
name "The MIT License (MIT)"
17+
url "https://opensource.org/licenses/MIT"
18+
distribution "repo"
19+
}
20+
}
21+
}
22+
23+
afterEvaluate {
24+
publishing {
25+
publications {
26+
release(MavenPublication) {
27+
groupId = rootProject.ext.group_id
28+
artifactId = rootProject.ext.artifact_id
29+
version = rootProject.ext.version_name
30+
31+
from components.release
32+
33+
artifact sourcesJar {
34+
classifier "sources"
35+
}
36+
37+
pom.withXml {
38+
def root = asNode()
39+
root.appendNode('name', 'PACE Cloud SDK')
40+
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.')
41+
root.appendNode('url', 'https://github.com/pace/cloud-sdk-android')
42+
root.children().last() + pomConfig
43+
}
44+
}
45+
}
46+
}
47+
}
48+
49+
bintray {
50+
user = rootProject.ext.user
51+
key = rootProject.ext.key
52+
publications = ['release']
53+
54+
pkg {
55+
repo = rootProject.ext.group_id
56+
name = rootProject.ext.artifact_id
57+
version {
58+
name = rootProject.ext.version_name
59+
desc = "PACE Cloud SDK version $rootProject.ext.version_name"
60+
released = new Date()
61+
vcsTag = rootProject.ext.version_name
62+
}
63+
}
64+
65+
publish = true
66+
}

0 commit comments

Comments
 (0)