From a92308993bf3e59373f368d456890842400c2be2 Mon Sep 17 00:00:00 2001 From: yarolegovich Date: Thu, 30 Jul 2020 20:11:23 +0300 Subject: [PATCH] New bintray upload setup --- build.gradle | 25 +++++++++++++++---------- library/build.gradle | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 2051b8c..8af4e19 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:4.0.1' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5' } } @@ -23,20 +24,24 @@ task clean(type: Delete) { ext { - userOrg = 'yarolegovich' - groupId = 'com.yarolegovich' - uploadName = 'LovelyDialog' - description = 'This library is a set of simple wrapper classes that are aimed to help you easily create fancy dialogs.' - publishVersion = '1.1.0' - licences = ['Apache-2.0'] - compileSdkVersion = 29 buildToolsVersion = '29.0.2' targetSdkVersion = 29 + upload = [ + user : 'yarolegovich', + userOrg : 'yarolegovich', + repository : 'maven', + groupId : 'com.yarolegovich', + uploadName : 'LovelyDialog', + description: 'This library is a set of simple wrapper classes that are aimed to help you easily create fancy dialogs.', + version : '1.1.1', + licences : ['Apache-2.0'] + ] + deps = [ - androidxCore : 'androidx.core:core:1.3.1', - androidxCompat : 'androidx.appcompat:appcompat:1.1.0', - annotations : 'androidx.annotation:annotation:1.1.0' + androidxCore : 'androidx.core:core:1.3.1', + androidxCompat: 'androidx.appcompat:appcompat:1.1.0', + annotations : 'androidx.annotation:annotation:1.1.0' ] } diff --git a/library/build.gradle b/library/build.gradle index 2225193..72e2bc2 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,4 +1,6 @@ apply plugin: 'com.android.library' +apply plugin: 'maven-publish' +apply plugin: 'com.jfrog.bintray' android { compileSdkVersion rootProject.compileSdkVersion @@ -18,3 +20,34 @@ dependencies { implementation deps.androidxCompat } +afterEvaluate { + publishing { + publications { + LibRelease(MavenPublication) { + from components.release + artifactId 'lovely-dialog' + groupId upload.groupId + version upload.version + } + } + } + + bintray { + user = upload.user + key = System.getenv('BINTRAY_KEY') + publications = ['LibRelease'] + configurations = ['archives'] + pkg { + name = upload.uploadName + repo = upload.repository + userOrg = upload.userOrg + licenses = upload.licences + publish = true + dryRun = false + version { + name = upload.version + desc = upload.description + } + } + } +} \ No newline at end of file