BobStore/build.gradle
Peter Serwylo aa38418c91 Bump support libraries to v20. Gradle doesn't build them by source for now.
The support libraries expect to be using the gradle plugin version 0.10.0.
We are currently on version 1.0.0. They use APIs in their build script which
have moved or been removed, and so the build just breaks when we run it with
the 1.0.0 plugin. I tried some magic to make it work in various ways, but
kept failing. As such, I've reverted the `gradle -PsourceDeps` build to not
build the support libraries from source. In the future, we should be able to
change this if they change the plugin version to a more recent one.

Note that the ant build script still hasn't been modified, and so will be
using the binary support-v4 library, but should build appcompat-v7 from source.

Was going to bump to Support v21, however there is some behaviour change which
causes a crash. They have removed the progress view from the toolbar/actionbar.
This breaks the AppDetails activity. As such, I'll leave that for the future.

For now, there will be a slight difference between building with
ant (which uses support v-almost-21) and gradle (which uses v20).
This will stay the case until we get around to completely porting
the app to v21, and fixing any bugs or UI sadness that arises.
2015-03-03 00:46:43 +11:00

100 lines
3.5 KiB
Groovy

/**
* This is *NOT* the main build script for F-Droid. The main build.gradle
* is in F-Droid/build.gradle. Usually multi-project builds don't have a
* build.gradle in the top level directory (http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Dependencies-Android-Libraries-and-Multi-project-setup).
*
* This build script contains miscellaneous hacks to ensure that all of
* F-Droids dependencies can be built from source.
* Each hack should be documented, and in the future, may need to be changed
* in order to ensure that we keep pace with any changes upstream makes to
* their build processes.
*
* - Some subprojects don't have gradle build scripts, so they are setup here.
*
* - The android support libraries make a lot of dependencies about the project
* two folders up from themselves, which we will have to provide for them.
*/
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// libsuperuser submodule requires these plugins, even though
// the F-Droid build process never invokes code from them. It
// would be nice to do away with this in the future, so we don't
// force people do download stuff they wont use.
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
}
}
if ( hasProperty( 'sourceDeps' ) ) {
project(':extern:UniversalImageLoader:library') {
apply plugin: 'android-library'
android {
compileSdkVersion 16
buildToolsVersion '21.1.2'
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')
}
}
}
subprojects {
// This is the hacky way which we force the subprojects to use the same build tools:
// http://stackoverflow.com/a/21032272
afterEvaluate {
if ( it.hasProperty( 'android' ) ) {
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 plugin 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 '21.1.2'
logger.info("Set buildToolsVersion to '21.1.2'")
} catch (GradleException e) {
logger.info("Tried to set the buildToolsVersion, however we were not allowed to: $e.message")
}
// don't abort build on lint errors
// http://stackoverflow.com/a/25149514
configure(android.lintOptions) {
abortOnError false
}
}
}
}
}