BobStore/build.gradle
Peter Serwylo 59b9fd6a8c add PreferenceFragment lib since appcompat lacks such a thing
Although Google is encouraging people to make old devices run apps
with the action bar (via appcompat-v7), they haven't provided a way
for people to create preference/setting screens with an action bar.

There are plenty of issues in the Android issue tracker relating
to this, but it doesn't yet seem to be on the radar of the Android
devs.

Until there is a native implementation of PreferenceFragment in
the appcompat-v7 support library, this submodule provides is a 3rd
party solution. It is actually a fork of the first repo in github,
though that was a bit of an upload and dump, without accepting MR's.
This fork includes gradle support.
2014-06-04 23:16:26 -04:00

145 lines
3.7 KiB
Groovy

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.10.0'
}
}
apply plugin: 'android'
def toolVersion = "19.1"
sdkLoc = android.plugin.sdkDirectory
FileCollection getAndroidPrebuilt(String apiLevel) {
files("$sdkLoc/platforms/android-$apiLevel/android.jar")
}
dependencies {
compile project(':support-v4')
compile project(':support-appcompat-v7')
compile project(':extern:AndroidPinning')
compile project(':extern:UniversalImageLoader:library')
compile project(':extern:MemorizingTrustManager')
compile project(':extern:libsuperuser:libsuperuser')
compile project(':extern:nanohttpd:core')
compile project(':extern:jmdns')
compile project(':extern:zipsigner')
compile project(':extern:zxing-core')
compile( project(':extern:android-support-v4-preferencefragment') ) {
exclude module: 'support-v4'
}
}
project(':extern:UniversalImageLoader:library') {
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.10.0'
}
}
apply plugin: 'android-library'
android {
compileSdkVersion 16
buildToolsVersion toolVersion
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}
}
project(':extern:zipsigner') {
apply plugin: 'java'
dependencies {
compile project(':extern:spongycastle:core')
compile project(':extern:spongycastle:pkix')
compile project(':extern:spongycastle:prov')
}
}
android {
compileSdkVersion 19
buildToolsVersion toolVersion
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('test')
}
buildTypes {
release {
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
tasks.withType(Compile) { task ->
options.encoding = "UTF-8"
}
}
// TODO: This person took the example code below from another blogpost online, however
// I lost the reference to it:
// http://stackoverflow.com/questions/23297562/gradle-javadoc-and-android-documentation
android.applicationVariants.all { variant ->
task("generate${variant.name}Javadoc", type: Javadoc) {
title = "$name $version API"
description "Generates Javadoc for F-Droid."
source = variant.javaCompile.source
ext.androidJar = "$sdkLoc/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar)
options.links("http://docs.oracle.com/javase/7/docs/api/");
options.links("http://d.android.com/reference/");
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
}
// This is the hacky way which we force the subprojects to use the same build tools:
// http://stackoverflow.com/a/21032272
subprojects {
afterEvaluate {
android {
// The android build task only lets you configure the buildToolsVersion once, so if
// we execute the closure below to configure our subprojects, it will fail when it
// hits the second subproject. Therefore, we will only do it once, and I guess the
// android plubin will re-use the existing value I set.
// https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/BaseExtension.groovy
try {
buildToolsVersion toolVersion
logger.info("Set buildToolsVersion to $toolVersion")
} catch (GradleException e) {
logger.info("Tried to set the buildToolsVersion, however we were not allowed to: $e.message")
}
}
}
}