diff options
author | Kevin Jin <kjin@google.com> | 2015-02-10 17:05:30 -0800 |
---|---|---|
committer | Kevin Jin <kjin@google.com> | 2015-02-10 17:05:30 -0800 |
commit | 2721cd91087f866e6a4c9d1d62221a36c31c4cd6 (patch) | |
tree | 018d1141453a0b5691f6948465df341ce2acb168 /build.gradle | |
parent | b8fc7911443ee5666ba46e016f11284f8ffa3662 (diff) | |
download | droiddriver-2721cd91087f866e6a4c9d1d62221a36c31c4cd6.tar.gz |
Build droiddriver as an Android library with Gradle
Update minSdkVersion to 12
Add @TargetApi appropriatedly to fix lint errors
Remove Eclipse files
Change-Id: I661d3fd0e8b2517ae9ee4ba1e489031a8846130d
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/build.gradle b/build.gradle index 6d9a1dd..83ffff7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,36 @@ -apply plugin: 'java' - -sourceSets { - main { - java { - srcDirs = ['src'] - } +// 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' } } -dependencies { - compile files('../../prebuilts/sdk/19/android.jar') +apply plugin: 'com.android.library' + +android { + compileSdkVersion 21 + buildToolsVersion "21.1.2" + + defaultConfig { + minSdkVersion 12 // TODO: need to support SDK 9? + targetSdkVersion 21 + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src'] + } + } } |