Deduplicate gradle code

This commit is contained in:
Daniel Martí 2015-10-13 22:24:54 +02:00
parent bbeef3cd8d
commit 9586c159a3

View File

@ -2,16 +2,8 @@ apply plugin: 'com.android.application'
apply plugin: 'witness'
apply plugin: 'checkstyle'
if (!hasProperty('sourceDeps')) {
repositories {
jcenter()
// This is here until we sort out all dependencies from mavenCentral/jcenter. Once all of
// the dependencies below have been sorted out, this can be removed.
flatDir {
dirs 'libs/binaryDeps'
}
}
dependencies {
@ -27,11 +19,26 @@ if (!hasProperty('sourceDeps')) {
compile 'eu.chainfire:libsuperuser:1.0.0.201510071325'
compile 'cc.mvdan.accesspoint:library:0.1.3'
compile 'info.guardianproject.netcipher:netcipher:1.2'
compile 'commons-net:commons-net:3.3'
compile 'org.openhab.jmdns:jmdns:3.4.2'
androidTestCompile 'commons-io:commons-io:2.2'
}
if (!hasProperty('sourceDeps')) {
repositories {
// This is here until we sort out all dependencies from mavenCentral/jcenter. Once all of
// the dependencies below have been sorted out, this can be removed.
flatDir {
dirs 'libs/binaryDeps'
}
}
dependencies {
compile 'com.madgag.spongycastle:pkix:1.51.0.0'
compile 'com.madgag.spongycastle:prov:1.51.0.0'
compile 'com.madgag.spongycastle:core:1.51.0.0'
compile 'commons-net:commons-net:3.3'
compile 'org.openhab.jmdns:jmdns:3.4.2'
// Upstream doesn't have a binary on mavenCentral/jcenter yet:
// https://github.com/kolavar/android-support-v4-preferencefragment/issues/13
@ -45,8 +52,6 @@ if (!hasProperty('sourceDeps')) {
// Google Code. We include this code directly in this repo, and have made
// modifications that should be pushed to anyone who wants to maintain it.
compile(name: 'zipsigner')
androidTestCompile 'commons-io:commons-io:2.2'
}
// Only do the libraries imported from maven repositories. Our own libraries
@ -75,35 +80,12 @@ if (!hasProperty('sourceDeps')) {
logger.info "Setting up *source* dependencies for F-Droid (because you passed in the -PsourceDeps argument to gradle while building)."
repositories {
jcenter()
}
dependencies {
compile project(':privileged-api-lib')
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-annotations:22.2.1'
compile 'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.google.zxing:core:3.2.1'
compile 'eu.chainfire:libsuperuser:1.0.0.201510071325'
compile 'cc.mvdan.accesspoint:library:0.1.3'
compile 'info.guardianproject.netcipher:netcipher:1.2'
compile 'commons-net:commons-net:3.3'
compile 'org.openhab.jmdns:jmdns:3.4.2'
compile(project(':extern:support-v4-preferencefragment')) {
exclude module: 'support-v4'
}
compile project(':extern:nanohttpd:core')
compile project(':extern:zipsigner')
androidTestCompile 'commons-io:commons-io:2.2'
}
}
task binaryDeps(type: Copy, dependsOn: ':F-Droid:prepareReleaseDependencies') {
@ -125,7 +107,7 @@ task binaryDeps(type: Copy, dependsOn: ':F-Droid:prepareReleaseDependencies') {
// rather libs/binaryDeps/project.aar.
details.path = details.name
}
}
}
android {
@ -188,7 +170,6 @@ android {
// since some devices ship deprecated locale codes
disable 'LocaleFolder'
}
}
task checkstyle(type: Checkstyle) {