2013-11-27 15:47:13 +01:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
dependencies {
|
2014-11-05 21:31:25 +01:00
|
|
|
classpath 'com.android.tools.build:gradle:0.14.1'
|
2013-11-27 15:47:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'android'
|
|
|
|
|
2014-11-05 21:31:25 +01:00
|
|
|
allprojects {
|
|
|
|
ext {
|
|
|
|
toolVersion = '21.1'
|
|
|
|
sdkLoc = getSdkPath()
|
|
|
|
}
|
|
|
|
}
|
2014-05-20 12:41:50 +10:00
|
|
|
|
2014-05-19 11:56:30 +02:00
|
|
|
FileCollection getAndroidPrebuilt(String apiLevel) {
|
2014-05-20 19:12:29 +02:00
|
|
|
files("$sdkLoc/platforms/android-$apiLevel/android.jar")
|
2014-05-19 11:56:30 +02:00
|
|
|
}
|
|
|
|
|
2013-11-27 15:47:13 +01:00
|
|
|
dependencies {
|
2014-05-19 11:56:30 +02:00
|
|
|
compile project(':support-v4')
|
2014-05-20 12:41:50 +10:00
|
|
|
compile project(':support-appcompat-v7')
|
2014-01-10 22:37:26 +01:00
|
|
|
compile project(':extern:AndroidPinning')
|
2014-02-14 12:17:07 +01:00
|
|
|
compile project(':extern:UniversalImageLoader:library')
|
2014-02-14 10:51:30 +01:00
|
|
|
compile project(':extern:MemorizingTrustManager')
|
2014-04-26 02:40:08 +02:00
|
|
|
compile project(':extern:libsuperuser:libsuperuser')
|
2014-05-18 12:54:21 +02:00
|
|
|
compile project(':extern:nanohttpd:core')
|
2014-05-21 08:48:13 +02:00
|
|
|
compile project(':extern:jmdns')
|
2014-05-20 17:00:46 +02:00
|
|
|
compile project(':extern:zipsigner')
|
2014-05-25 13:39:56 +02:00
|
|
|
compile project(':extern:zxing-core')
|
2014-06-03 08:16:18 +09:30
|
|
|
compile( project(':extern:android-support-v4-preferencefragment') ) {
|
|
|
|
exclude module: 'support-v4'
|
|
|
|
}
|
2013-11-27 15:47:13 +01:00
|
|
|
}
|
|
|
|
|
2014-03-22 11:44:27 +01:00
|
|
|
project(':extern:UniversalImageLoader:library') {
|
2014-02-20 09:55:54 +01:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
dependencies {
|
2014-05-21 11:42:46 +02:00
|
|
|
classpath 'com.android.tools.build:gradle:0.10.0'
|
2014-02-20 09:55:54 +01:00
|
|
|
}
|
|
|
|
}
|
2014-02-14 12:17:07 +01:00
|
|
|
|
2014-05-18 12:54:21 +02:00
|
|
|
apply plugin: 'android-library'
|
2014-03-22 11:44:27 +01:00
|
|
|
|
2014-02-15 12:31:15 +01:00
|
|
|
android {
|
|
|
|
compileSdkVersion 16
|
2014-05-18 12:54:21 +02:00
|
|
|
buildToolsVersion toolVersion
|
2014-02-14 12:17:07 +01:00
|
|
|
|
2014-02-15 12:31:15 +01:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
manifest.srcFile 'AndroidManifest.xml'
|
|
|
|
java.srcDirs = ['src']
|
2014-05-28 09:07:15 +02:00
|
|
|
resources.srcDirs = ['src']
|
2014-02-15 12:31:15 +01:00
|
|
|
aidl.srcDirs = ['src']
|
|
|
|
renderscript.srcDirs = ['src']
|
2014-05-28 09:07:15 +02:00
|
|
|
res.srcDirs = ['res']
|
|
|
|
assets.srcDirs = ['assets']
|
2014-02-15 12:31:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-23 11:06:32 +02:00
|
|
|
project(':extern:zipsigner') {
|
|
|
|
|
2014-05-28 09:07:15 +02:00
|
|
|
apply plugin: 'java'
|
2014-05-23 11:06:32 +02:00
|
|
|
|
2014-05-28 09:07:15 +02:00
|
|
|
dependencies {
|
|
|
|
compile project(':extern:spongycastle:core')
|
|
|
|
compile project(':extern:spongycastle:pkix')
|
|
|
|
compile project(':extern:spongycastle:prov')
|
|
|
|
}
|
2014-05-23 11:06:32 +02:00
|
|
|
}
|
|
|
|
|
2013-11-27 15:47:13 +01:00
|
|
|
android {
|
2014-11-05 21:39:22 +01:00
|
|
|
compileSdkVersion 21
|
2014-05-20 19:12:29 +02:00
|
|
|
buildToolsVersion toolVersion
|
2013-11-27 15:47:13 +01:00
|
|
|
|
2014-06-05 10:23:55 +02:00
|
|
|
compileOptions {
|
2014-06-05 10:32:57 +02:00
|
|
|
sourceCompatibility JavaVersion.VERSION_1_7
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_7
|
2014-06-05 10:23:55 +02:00
|
|
|
}
|
|
|
|
|
2013-11-27 15:47:13 +01:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
manifest.srcFile 'AndroidManifest.xml'
|
2014-02-14 10:34:36 +01:00
|
|
|
java.srcDirs = ['src']
|
2013-11-27 15:47:13 +01:00
|
|
|
resources.srcDirs = ['src']
|
|
|
|
aidl.srcDirs = ['src']
|
|
|
|
renderscript.srcDirs = ['src']
|
|
|
|
res.srcDirs = ['res']
|
|
|
|
assets.srcDirs = ['assets']
|
|
|
|
}
|
|
|
|
|
2014-02-09 16:34:36 +01:00
|
|
|
instrumentTest.setRoot('test')
|
2013-11-27 15:47:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
2014-11-05 21:31:25 +01:00
|
|
|
minifyEnabled false
|
2013-11-27 15:47:13 +01:00
|
|
|
}
|
|
|
|
}
|
2014-01-08 14:14:43 +01:00
|
|
|
|
2014-11-05 21:31:25 +01:00
|
|
|
compileOptions.encoding = "UTF-8"
|
2014-05-18 12:54:21 +02:00
|
|
|
|
2014-11-05 21:36:35 +01:00
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
}
|
|
|
|
|
2014-05-18 12:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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 ->
|
|
|
|
|
2014-05-20 19:12:29 +02:00
|
|
|
task("generate${variant.name}Javadoc", type: Javadoc) {
|
|
|
|
title = "$name $version API"
|
|
|
|
description "Generates Javadoc for F-Droid."
|
|
|
|
source = variant.javaCompile.source
|
2014-05-21 11:42:46 +02:00
|
|
|
ext.androidJar = "$sdkLoc/platforms/${android.compileSdkVersion}/android.jar"
|
2014-05-20 19:12:29 +02:00
|
|
|
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'
|
|
|
|
}
|
2014-05-18 12:54:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
subprojects {
|
2014-06-04 23:12:49 -04:00
|
|
|
|
|
|
|
// The support-v4 library assumes certain things are defined in the
|
|
|
|
// root project (which is usually the android-support project, but
|
|
|
|
// this time it is the F-Droid project.
|
|
|
|
if (project.name.equals("support-v4")) {
|
|
|
|
apply plugin: 'maven'
|
|
|
|
rootProject.ext.supportRepoOut = ""
|
|
|
|
}
|
|
|
|
|
2014-06-05 10:20:06 +02:00
|
|
|
// This is the hacky way which we force the subprojects to use the same build tools:
|
|
|
|
// http://stackoverflow.com/a/21032272
|
2014-05-20 19:12:29 +02:00
|
|
|
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")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-11-27 15:47:13 +01:00
|
|
|
}
|
2014-05-27 06:30:09 +09:30
|
|
|
|
|
|
|
/**
|
|
|
|
* Currently a bit hacky, because android.plugin is protected.
|
|
|
|
* The end goal is to find something in the android BaseExtension class found here:
|
|
|
|
* https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/BaseExtension.groovy
|
|
|
|
* which ends up asking their Sdk class for it's location. That class knows about
|
|
|
|
* both ANDROID_HOME env variables, and also local.properties sdk.loc properties.
|
|
|
|
*
|
|
|
|
* If in the future, the android.adbExe is found to be inappropriate, deprecated,
|
|
|
|
* or a better way of finding the sdk path exists, we can change the implementation
|
|
|
|
* of this method to reflect that.
|
|
|
|
*/
|
|
|
|
def getSdkPath() {
|
2014-11-05 21:31:25 +01:00
|
|
|
new File("$android.adbExe/../../").canonicalPath
|
2014-05-27 06:30:09 +09:30
|
|
|
}
|