aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--third_party/sl4a/build.gradle98
-rw-r--r--third_party/sl4a/gradle.properties4
3 files changed, 101 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 6157034..13372f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
.gradle/
.idea/
-
build/
*.iml
*.pro
+bintray.properties
local.properties
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