Skip to content

Commit

Permalink
Bintray (#4)
Browse files Browse the repository at this point in the history
* back to bintray, fingers crossed!

* fixed an issue with the gradle script

* sample now pulls in the maven repo
  • Loading branch information
ersen-lw authored Dec 6, 2018
1 parent 57493c6 commit 097ba22
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 4 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {

dependencies {
implementation "com.android.support:appcompat-v7:${project.supportVersion}"
implementation project(path: ':rxgps')
implementation "com.ersen:rxGps:1.1.1"

implementation "io.reactivex.rxjava2:rxandroid:${project.rxJava2Android}"
implementation "io.reactivex.rxjava2:rxjava:${project.rxJava2}"
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -18,6 +19,7 @@ allprojects {
jcenter()
google()
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/erseno/RxGps' }
}
}

Expand Down
8 changes: 5 additions & 3 deletions rxgps/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group='com.github.ersen'

android {
compileSdkVersion project.sdk
Expand All @@ -9,7 +7,7 @@ android {
minSdkVersion project.minSdk
targetSdkVersion project.sdk
versionCode 2
versionName "1.1"
versionName "1.1.1"
}

compileOptions {
Expand All @@ -23,3 +21,7 @@ dependencies {
implementation "com.google.android.gms:play-services-location:${project.playServicesLocation}"
implementation "com.github.tbruyelle:rxpermissions:${project.tbruyelleRxPermissions}"
}

if(project.rootProject.file('credentials.properties').exists()){
apply from: 'publish.gradle'
}
57 changes: 57 additions & 0 deletions rxgps/publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

version '1.1.1' // your library version
group 'com.ersen' // whatever group name you'd like

publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/outputs/aar/rxgps-release.aar") // replace with your library name
groupId this.group
artifactId 'rxGps' // replace with your library artifact id
version this.version

pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')

// Iterate over the implementation dependencies (we don't want the test ones),
// adding a <dependency> node for each
configurations.implementation.allDependencies.each {
// Ensure dependencies such as fileTree are not included in the pom.
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}

bintray {
def credentialsPropertiesFile = rootProject.file("credentials.properties")
def credentialsProperties = new Properties()
credentialsProperties.load(new FileInputStream(credentialsPropertiesFile))
user = credentialsProperties['bintray.user']
key = credentialsProperties['bintray.apikey']
publications = ['Production']
configurations = ['archives']
// Default: false. Whether to run this as dry-run, without deploying
dryRun = false
// Default: false. Whether to override version artifacts already published
override = false
// Default: false. Whether version should be auto published after an upload
publish = true
pkg {
repo = 'RxGps' // the name of the repository you created on Bintray
name = 'com.ersen.rxgps' // the name of the package you created inside it
version {
name = this.version
released = new Date()
vcsTag = this.version
}
}
}

0 comments on commit 097ba22

Please sign in to comment.