Skip to content

Commit 2daffec

Browse files
committed
Configure Bintray deployment
1 parent 5d4253e commit 2daffec

File tree

3 files changed

+119
-15
lines changed

3 files changed

+119
-15
lines changed

blurkit/build.gradle

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
apply plugin: 'com.android.library'
2-
apply plugin: 'kotlin-android'
1+
plugins {
2+
id 'com.android.library'
3+
id 'kotlin-android'
4+
id 'com.github.dcendents.android-maven' version '1.5'
5+
}
36

47
ext {
5-
PUBLISH_GROUP_ID = 'com.alterac.blurkit'
6-
PUBLISH_ARTIFACT_ID = 'blurkit-core'
8+
PUBLISH_GROUP_ID = 'io.alterac.blurkit'
9+
PUBLISH_ARTIFACT_ID = 'blurkit'
710
PUBLISH_VERSION = '1.0.0'
811
}
912

1013
android {
11-
compileSdkVersion 28
14+
compileSdkVersion versions.compileSdk
1215
buildToolsVersion '28.0.2'
1316

1417
defaultConfig {
15-
minSdkVersion 21
16-
targetSdkVersion 28
18+
minSdkVersion versions.minSdk
19+
targetSdkVersion versions.targetSdk
1720
versionCode 1
1821
versionName "1.0.0"
1922
renderscriptTargetApi 28
@@ -42,7 +45,14 @@ dependencies {
4245

4346
}
4447

45-
apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
46-
repositories {
47-
mavenCentral()
48-
}
48+
install {
49+
repositories.mavenInstaller {
50+
pom.project {
51+
groupId project.group
52+
artifactId 'blurkit'
53+
packaging 'aar'
54+
}
55+
}
56+
}
57+
58+
apply from : 'deploy.gradle'

blurkit/deploy.gradle

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
def getBintrayUser() {
2+
if (System.getenv('BINTRAY_USER')) {
3+
logger.lifecycle(System.getenv('BINTRAY_USER'))
4+
return System.getenv('BINTRAY_USER')
5+
} else if (rootProject.file('local.properties').exists()) {
6+
Properties properties = new Properties()
7+
properties.load(rootProject.file('local.properties').newDataInputStream())
8+
return properties.getProperty('bintray.user')
9+
} else {
10+
logger.lifecycle("Warning: Could not find BINTRAY_USER in environment or local.properties")
11+
}
12+
}
13+
14+
def getBintrayKey() {
15+
if (System.getenv('BINTRAY_KEY')) {
16+
logger.lifecycle(System.getenv('BINTRAY_KEY'))
17+
return System.getenv('BINTRAY_KEY')
18+
} else if (rootProject.file('local.properties').exists()) {
19+
Properties properties = new Properties()
20+
properties.load(rootProject.file('local.properties').newDataInputStream())
21+
return properties.getProperty('bintray.key')
22+
} else {
23+
logger.lifecycle("Warning: Could not find BINTRAY_KEY in environment or local.properties")
24+
}
25+
}
26+
27+
apply plugin: 'com.jfrog.bintray'
28+
29+
bintray {
30+
user = getBintrayUser()
31+
key = getBintrayKey()
32+
configurations = ['archives']
33+
pkg {
34+
repo = 'other'
35+
name = 'blurkit-android'
36+
userOrg = 'camerakit'
37+
vcsUrl = 'https://github.com/CameraKit/blurkit-android.git'
38+
licenses = ['MIT']
39+
40+
version {
41+
name = project.version
42+
released = new Date()
43+
}
44+
}
45+
}
46+
47+
task cleanForDeployment {
48+
doLast {
49+
logger.lifecycle('BlurKit: Deployment: Cleaning...')
50+
logger.lifecycle('Deleting: ' + project.buildDir)
51+
delete project.buildDir
52+
}
53+
}
54+
55+
task buildForDeployment {
56+
logger.lifecycle('BlurKit: Deployment: Building...')
57+
shouldRunAfter(cleanForDeployment)
58+
finalizedBy assemble
59+
60+
doFirst {
61+
android.variantFilter { variant ->
62+
if (variant.buildType.name == 'debug') {
63+
variant.setIgnore(true)
64+
}
65+
}
66+
}
67+
}
68+
69+
task deployRelease {
70+
logger.lifecycle('BlurKit - Starting Release Deployment')
71+
shouldRunAfter(buildForDeployment)
72+
73+
dependsOn cleanForDeployment
74+
dependsOn buildForDeployment
75+
finalizedBy bintrayUpload
76+
77+
doLast {
78+
logger.lifecycle(bintrayUpload.getVersionName())
79+
bintrayUpload.setVersionName(bintrayUpload.getVersionName())
80+
bintrayUpload.setUserOrg('camerakit')
81+
bintrayUpload.setRepoName('other')
82+
83+
logger.lifecycle('Deploying version ' + bintrayUpload.getVersionName() + ' in ' + bintrayUpload.getRepoName())
84+
}
85+
}

build.gradle

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,26 @@ buildscript {
99
dependencies {
1010
classpath 'com.android.tools.build:gradle:3.2.0'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12-
13-
// NOTE: Do not place your application dependencies here; they belong
14-
// in the individual module build.gradle files
12+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
1513
}
1614
}
1715

18-
allprojects {
16+
allprojects { project ->
17+
group = 'io.alterac.blurkit'
18+
version = '1.0.0'
19+
1920
repositories {
2021
google()
2122
jcenter()
2223
}
24+
25+
ext {
26+
versions = [
27+
minSdk : 21,
28+
targetSdk : 28,
29+
compileSdk : 28,
30+
]
31+
}
2332
}
2433

2534
task clean(type: Delete) {

0 commit comments

Comments
 (0)