| // If building from command line and you don't have the file local.properties that specifies |
| // sdk.dir for the Android SDK path, you can run |
| // $ ANDROID_HOME=/path/to/android-sdk gradle build |
| buildscript { |
| repositories { |
| jcenter() |
| } |
| dependencies { |
| // this requires Gradle 2 |
| classpath 'com.android.tools.build:gradle:1.0.1' |
| classpath 'com.github.dcendents:android-maven-plugin:1.2' |
| classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+' |
| } |
| } |
| |
| // Requires Grade >= 2.1 |
| plugins { |
| id 'com.jfrog.bintray' version '1.1' |
| } |
| apply plugin: 'android-sdk-manager' |
| apply plugin: 'com.android.library' |
| |
| tasks.withType(JavaCompile) { |
| options.compilerArgs << '-Xlint:deprecation' |
| } |
| |
| def ddArtifactId = 'droiddriver' |
| def ddGroup = 'io.appium' |
| def ddVersion = '0.9.1-SNAPSHOT' |
| def ddWebsite = 'https://github.com/appium/droiddriver' |
| def ddTracker = 'https://github.com/appium/droiddriver/issues' |
| def ddGit = 'https://github.com/appium/droiddriver.git' |
| def ddDescription = 'Android UI testing framework' |
| version = ddVersion |
| group = ddGroup |
| |
| android { |
| compileSdkVersion 21 |
| buildToolsVersion '21.1.2' |
| |
| defaultConfig { |
| minSdkVersion 12 // TODO: need to support SDK 9? |
| targetSdkVersion 21 |
| versionCode 1 |
| versionName version |
| } |
| |
| compileOptions { |
| sourceCompatibility JavaVersion.VERSION_1_7 |
| targetCompatibility JavaVersion.VERSION_1_7 |
| } |
| |
| sourceSets { |
| main { |
| manifest.srcFile 'AndroidManifest.xml' |
| java.srcDirs = ['src'] |
| } |
| } |
| |
| lintOptions { |
| // Aborting on lint errors prevents jenkins from processing the Lint output |
| // https://wiki.jenkins-ci.org/display/JENKINS/Android%20Lint%20Plugin |
| abortOnError false |
| } |
| } |
| |
| apply plugin: 'com.github.dcendents.android-maven' |
| |
| install { |
| repositories.mavenInstaller { |
| pom { |
| project { |
| packaging 'aar' |
| version = ddVersion |
| groupId = ddGroup |
| artifactId = ddArtifactId |
| |
| description = ddDescription |
| url ddWebsite |
| |
| licenses { |
| license { |
| name 'The Apache Software License, Version 2.0' |
| url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| } |
| } |
| |
| scm { |
| connection ddGit |
| developerConnection ddGit |
| url ddWebsite |
| } |
| |
| issueManagement { |
| url ddTracker |
| } |
| } |
| } |
| } |
| } |
| |
| task sourcesJar(type: Jar) { |
| from android.sourceSets.main.java.srcDirs |
| classifier = 'sources' |
| } |
| |
| task javadoc(type: Javadoc) { |
| source = android.sourceSets.main.java.srcDirs |
| classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) |
| if (System.getProperty('java.specification.version') == '1.8') { |
| // '-quiet' is not related to -Xdoclint. In fact it is default for the Javadoc task. |
| // It is needed here because of a Gradle bug: addStringOption(String option) does not work. |
| // addStringOption(String option, String value) adds both option and value to the generated |
| // file javadoc.options, and value must be a valid javadoc command line option. |
| options.addStringOption('Xdoclint:all,-missing', '-quiet') |
| } |
| } |
| |
| task javadocJar(type: Jar, dependsOn: javadoc) { |
| classifier = 'javadoc' |
| from javadoc.destinationDir |
| } |
| |
| artifacts { |
| archives javadocJar |
| archives sourcesJar |
| } |
| |
| Properties properties = new Properties() |
| properties.load(project.rootProject.file('local.properties').newDataInputStream()) |
| |
| bintray { |
| publish = true |
| user = properties.getProperty('bintray.user') |
| key = properties.getProperty('bintray.key') |
| |
| configurations = ['archives'] |
| pkg { |
| repo = 'maven' |
| userOrg = 'appium' |
| name = "${ddGroup}:${ddArtifactId}" |
| websiteUrl = ddWebsite |
| issueTrackerUrl = ddTracker |
| vcsUrl = ddGit |
| desc = ddDescription |
| licenses = ['The Apache Software License, Version 2.0'] |
| publicDownloadNumbers = true |
| version { |
| name = ddVersion |
| desc = ddDescription |
| } |
| } |
| } |