diff --git a/build.gradle b/build.gradle index 0a596a1..66fd81e 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:4.0.1' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5' } } @@ -22,13 +23,6 @@ task clean(type: Delete) { } ext { - userOrg = 'yarolegovich' - groupId = 'com.yarolegovich' - uploadName = 'DiscreteScrollView' - desc = 'A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.' - publishVersion = '1.4.9' - licences = ['Apache-2.0'] - compileSdkVersion = 29 buildToolsVersion = '29.0.2' targetSdkVersion = 29 diff --git a/library/build.gradle b/library/build.gradle index ee71a80..8daa89d 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.library' +apply from: rootProject.file('release-bintray.gradle') android { compileSdkVersion rootProject.compileSdkVersion diff --git a/release-bintray.gradle b/release-bintray.gradle new file mode 100644 index 0000000..e542643 --- /dev/null +++ b/release-bintray.gradle @@ -0,0 +1,60 @@ +apply plugin: 'maven-publish' +apply plugin: 'com.jfrog.bintray' + +def upload = [ + user : 'yarolegovich', + artifactId : 'discrete-scrollview', + userOrg : 'yarolegovich', + repository : 'maven', + groupId : 'com.yarolegovich', + uploadName : 'DiscreteScrollView', + description: 'A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.', + version : '1.5.0', + licences : ['Apache-2.0'] +] + +task androidSourcesJar(type: Jar) { + archiveClassifier.set('sources') + from android.sourceSets.main.java.srcDirs +} + +version upload.version + +afterEvaluate { + + publishing { + publications { + LibRelease(MavenPublication) { + from components.release + + artifact androidSourcesJar + + artifactId upload.artifactId + groupId upload.groupId + version upload.version + } + } + } + + Properties localProps = new Properties() + localProps.load(project.rootProject.file('local.properties').newDataInputStream()) + + bintray { + user = upload.user + key = localProps.getProperty('bintray.api_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