Skip to content

Commit

Permalink
publish logan to jcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard-Cao committed Sep 26, 2018
1 parent 24e014d commit ac5bcdb
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 3 deletions.
54 changes: 54 additions & 0 deletions Example/Logan-Android/bintrayUpload.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
group = groupId
artifactId = artifactId
version = versionCode

def getPropertyFromLocalProperties(key) {
File file = project.rootProject.file('local.properties')
if (file.exists()) {
Properties properties = new Properties()
properties.load(file.newDataInputStream())
return properties.getProperty(key)
}
}

def siteUrl = 'https://tech.meituan.com/Logan.html'
def gitUrl = 'https://github.com/Meituan-Dianping/Logan'

bintray {
user = getPropertyFromLocalProperties("bintray.user")
key = getPropertyFromLocalProperties("bintray.apikey")
configurations = ['archives']
pkg {
repo = 'maven'
name = "${project.group}:${project.name}"
userOrg = 'dianping'
licenses = ['MIT']
websiteUrl = siteUrl
vcsUrl = gitUrl
publish = true
}
}

install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
groupId groupId
artifactId artifactId
version versionCode
}
}
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

artifacts {
archives sourcesJar
}
1 change: 1 addition & 0 deletions Example/Logan-Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
3 changes: 3 additions & 0 deletions Example/Logan-Android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
groupId=com.dianping.android.sdk
artifactId=logan
versionCode=1.0.0
4 changes: 1 addition & 3 deletions Example/Logan-Android/logan/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group='com.dianping.logan'
apply from: rootProject.file("bintrayUpload.gradle")

android {
// publishNonDefault true
Expand Down

0 comments on commit ac5bcdb

Please sign in to comment.