aboutsummaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorAlexander Dorokhine <adorokhine@google.com>2017-01-12 17:56:32 -0800
committeradorokhine <adorokhine@google.com>2017-01-13 16:19:34 -0800
commit29932a57506f370b4db537111ac0687d1cf531b2 (patch)
tree06d75429c3b6345113b852278b1d45478de8188f /third_party
parent513dcd74797b3dc0d58bc86ad31278c0b8f9d91d (diff)
downloadmobly-snippet-lib-29932a57506f370b4db537111ac0687d1cf531b2.tar.gz
Add bintray packaging info into build.gradle.
Diffstat (limited to 'third_party')
-rw-r--r--third_party/sl4a/build.gradle98
-rw-r--r--third_party/sl4a/gradle.properties4
2 files changed, 100 insertions, 2 deletions
diff --git a/third_party/sl4a/build.gradle b/third_party/sl4a/build.gradle
index 71077cd..13f63ae 100644
--- a/third_party/sl4a/build.gradle
+++ b/third_party/sl4a/build.gradle
@@ -1,4 +1,16 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+ }
+}
+
apply plugin: 'com.android.library'
+apply plugin: 'com.jfrog.bintray'
+apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 24
@@ -7,8 +19,12 @@ android {
defaultConfig {
minSdkVersion 11
targetSdkVersion 24
- versionCode 2
- versionName "1.0.0"
+ versionCode VERSION_CODE.toInteger()
+ versionName VERSION_NAME
+ // Need to set up some project properties to publish to bintray.
+ project.group = GROUP_ID
+ project.archivesBaseName = ARTIFACT_ID
+ project.version = VERSION_NAME
}
}
@@ -36,3 +52,81 @@ artifacts {
archives javadocJar
archives sourcesJar
}
+
+// bintray packaging information
+install {
+ repositories.mavenInstaller {
+ pom.project {
+ name ARTIFACT_ID
+ description
+ 'Library for triggering device-side code from host-side ' +
+ 'Mobly tests.'
+ url 'https://github.com/google/mobly-snippet-lib'
+
+ packaging 'aar'
+ groupId GROUP_ID
+ artifactId ARTIFACT_ID
+ version VERSION_NAME
+ name ARTIFACT_ID
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+ scm {
+ connection 'https://github.com/google/mobly-snippet-lib.git'
+ url 'https://github.com/google/mobly-snippet-lib'
+ }
+ }
+ }
+}
+
+// Try loading bintray.properties. It's okay if this fails; we might not be
+// uploading.
+def bintrayPropFile = project.rootProject.file('bintray.properties')
+if (bintrayPropFile.exists()) {
+ Properties prop = new Properties()
+ prop.load(new FileInputStream(bintrayPropFile))
+ project.ext.bintrayUser = prop.user
+ project.ext.bintrayKey = prop.key
+} else {
+ project.ext.bintrayUser = null
+ project.ext.bintrayKey = null
+}
+
+gradle.taskGraph.whenReady { graph ->
+ if (graph.hasTask(bintrayUpload)) {
+ if (project.bintrayUser == null || project.bintrayKey == null) {
+ if (bintrayPropFile.exists()) {
+ throw new IllegalArgumentException(
+ bintrayPropFile.toString()
+ + " does not contain 'user' or 'key' props")
+ } else {
+ throw new FileNotFoundException(
+ "bintray.properties not found at path: " + bintrayPropFile)
+ }
+ }
+ }
+}
+
+bintray {
+ user = project.bintrayUser
+ key = project.bintrayKey
+ configurations = ['archives']
+ pkg {
+ repo = 'mobly'
+ name = ARTIFACT_ID
+ userOrg = 'google'
+ licenses = ['Apache-2.0']
+ vcsUrl = 'https://github.com/google/mobly-snippet-lib.git'
+ version {
+ name = VERSION_NAME
+ desc = 'Mobly Snippet Lib ' + VERSION_NAME
+ released = new Date()
+ vcsTag = VERSION_NAME
+ }
+ }
+}
diff --git a/third_party/sl4a/gradle.properties b/third_party/sl4a/gradle.properties
new file mode 100644
index 0000000..8a6ed25
--- /dev/null
+++ b/third_party/sl4a/gradle.properties
@@ -0,0 +1,4 @@
+VERSION_CODE=2
+VERSION_NAME=1.0.0
+GROUP_ID=com.google.android.mobly
+ARTIFACT_ID=mobly-snippet-lib