diff --git a/Example/Logan-Android/bintrayUpload.gradle b/Example/Logan-Android/bintrayUpload.gradle new file mode 100644 index 0000000..6e636d3 --- /dev/null +++ b/Example/Logan-Android/bintrayUpload.gradle @@ -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 +} \ No newline at end of file diff --git a/Example/Logan-Android/build.gradle b/Example/Logan-Android/build.gradle index b26c742..14469e4 100644 --- a/Example/Logan-Android/build.gradle +++ b/Example/Logan-Android/build.gradle @@ -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 diff --git a/Example/Logan-Android/gradle.properties b/Example/Logan-Android/gradle.properties index aac7c9b..448effc 100644 --- a/Example/Logan-Android/gradle.properties +++ b/Example/Logan-Android/gradle.properties @@ -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 \ No newline at end of file diff --git a/Example/Logan-Android/logan/build.gradle b/Example/Logan-Android/logan/build.gradle index 60a7f5c..7cde618 100644 --- a/Example/Logan-Android/logan/build.gradle +++ b/Example/Logan-Android/logan/build.gradle @@ -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