2014-12-10 10:53:37 +01:00
|
|
|
apply plugin: 'com.android.application'
|
2015-10-08 16:50:07 +02:00
|
|
|
apply plugin: 'checkstyle'
|
2016-03-01 17:30:48 +00:00
|
|
|
apply plugin: 'pmd'
|
2015-10-08 17:11:22 +02:00
|
|
|
|
2016-05-19 08:27:50 +02:00
|
|
|
/* gets the version name from the latest Git tag, stripping the leading v off */
|
|
|
|
def getVersionName = { ->
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine 'git', 'describe', '--tags', '--always'
|
|
|
|
standardOutput = stdout
|
|
|
|
}
|
2017-07-08 00:10:45 +02:00
|
|
|
return stdout.toString().trim()
|
2016-05-19 08:27:50 +02:00
|
|
|
}
|
|
|
|
|
2017-10-25 22:15:40 +02:00
|
|
|
def isCi = "true".equals(System.getenv("CI"))
|
|
|
|
def preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
|
|
|
|
|
2018-05-30 17:44:21 +02:00
|
|
|
def fullApplicationId = "org.fdroid.fdroid"
|
|
|
|
def basicApplicationId = "org.fdroid.basic"
|
2018-07-20 11:47:52 +02:00
|
|
|
// yes, this actually needs both quotes https://stackoverflow.com/a/41391841
|
|
|
|
def privilegedExtensionApplicationId = '"org.fdroid.fdroid.privileged"'
|
2018-05-30 17:44:21 +02:00
|
|
|
|
2014-11-15 22:14:14 +01:00
|
|
|
android {
|
2018-04-19 12:24:28 +02:00
|
|
|
compileSdkVersion 27
|
|
|
|
buildToolsVersion '27.0.3'
|
2014-11-15 22:14:14 +01:00
|
|
|
|
2018-06-15 11:31:00 +02:00
|
|
|
defaultConfig {
|
2018-07-31 14:40:10 +02:00
|
|
|
versionCode 1003050
|
2018-06-15 11:31:00 +02:00
|
|
|
versionName getVersionName()
|
|
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
|
2014-11-15 22:14:14 +01:00
|
|
|
buildTypes {
|
2015-11-14 14:05:15 +01:00
|
|
|
// use proguard on debug too since we have unknowingly broken
|
|
|
|
// release builds before.
|
2015-08-09 19:09:02 -07:00
|
|
|
all {
|
2015-08-15 13:18:40 -07:00
|
|
|
minifyEnabled true
|
2016-04-13 13:25:53 +01:00
|
|
|
useProguard true
|
2015-08-15 13:18:40 -07:00
|
|
|
shrinkResources true
|
2018-07-20 11:47:52 +02:00
|
|
|
buildConfigField "String", "PRIVILEGED_EXTENSION_PACKAGE_NAME", privilegedExtensionApplicationId
|
2015-08-15 13:18:40 -07:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
2016-04-04 11:59:35 +02:00
|
|
|
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'src/androidTest/proguard-rules.pro'
|
2014-11-15 22:14:14 +01:00
|
|
|
}
|
2018-06-15 11:31:00 +02:00
|
|
|
debug {
|
|
|
|
applicationIdSuffix ".debug"
|
|
|
|
resValue "string", "applicationId", fullApplicationId + applicationIdSuffix
|
|
|
|
versionNameSuffix "-debug"
|
|
|
|
println 'buildTypes.debug defaultConfig.versionCode ' + defaultConfig.versionCode
|
|
|
|
}
|
2014-11-15 22:14:14 +01:00
|
|
|
}
|
|
|
|
|
2018-05-30 17:44:21 +02:00
|
|
|
flavorDimensions "base"
|
|
|
|
productFlavors {
|
|
|
|
full {
|
|
|
|
dimension "base"
|
|
|
|
applicationId fullApplicationId
|
|
|
|
resValue "string", "applicationId", fullApplicationId
|
|
|
|
}
|
|
|
|
basic {
|
|
|
|
dimension "base"
|
|
|
|
applicationId basicApplicationId
|
|
|
|
resValue "string", "applicationId", basicApplicationId
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-20 18:37:05 +02:00
|
|
|
compileOptions {
|
|
|
|
compileOptions.encoding = "UTF-8"
|
|
|
|
}
|
|
|
|
|
2017-09-02 23:01:09 +02:00
|
|
|
aaptOptions {
|
|
|
|
cruncherEnabled = false
|
|
|
|
}
|
|
|
|
|
2017-10-25 22:15:40 +02:00
|
|
|
dexOptions {
|
|
|
|
// Improve build server performance by allowing disabling of pre-dexing
|
|
|
|
// see http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance
|
|
|
|
// Skip pre-dexing when running on CI or when disabled via -Dpre-dex=false.
|
|
|
|
preDexLibraries = preDexEnabled && !isCi
|
|
|
|
}
|
|
|
|
|
2016-03-22 16:08:17 +01:00
|
|
|
testOptions {
|
2016-05-10 14:34:15 +02:00
|
|
|
unitTests {
|
2018-04-19 15:45:52 +02:00
|
|
|
includeAndroidResources = true
|
2016-05-10 14:34:15 +02:00
|
|
|
// prevent tests from dying on android.util.Log calls
|
|
|
|
returnDefaultValues = true
|
|
|
|
all {
|
|
|
|
// All the usual Gradle options.
|
|
|
|
testLogging {
|
|
|
|
events "skipped", "failed", "standardOut", "standardError"
|
|
|
|
showStandardStreams = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-03-22 16:08:17 +01:00
|
|
|
}
|
|
|
|
|
2016-10-07 12:15:15 +02:00
|
|
|
sourceSets {
|
|
|
|
test {
|
|
|
|
java.srcDirs += "$projectDir/src/testShared/java"
|
|
|
|
}
|
|
|
|
|
|
|
|
androidTest {
|
|
|
|
java.srcDirs += "$projectDir/src/testShared/java"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-20 18:37:05 +02:00
|
|
|
lintOptions {
|
|
|
|
checkReleaseBuilds false
|
2016-06-17 09:10:35 +02:00
|
|
|
abortOnError true
|
2015-07-28 21:39:33 -07:00
|
|
|
|
2015-08-09 21:33:36 -07:00
|
|
|
htmlReport true
|
|
|
|
xmlReport false
|
|
|
|
textReport false
|
|
|
|
|
2017-05-10 13:45:50 +02:00
|
|
|
lintConfig file("lint.xml")
|
2015-05-20 18:37:05 +02:00
|
|
|
}
|
2015-11-01 14:25:58 +01:00
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
exclude 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/LICENSE.txt'
|
|
|
|
exclude 'META-INF/NOTICE'
|
|
|
|
exclude 'META-INF/NOTICE.txt'
|
|
|
|
exclude 'META-INF/INDEX.LIST'
|
|
|
|
exclude '.readme'
|
|
|
|
}
|
2014-11-15 22:14:14 +01:00
|
|
|
}
|
2015-10-08 17:11:22 +02:00
|
|
|
|
2018-06-01 11:08:30 +02:00
|
|
|
dependencies {
|
|
|
|
implementation 'com.android.support:support-v4:27.1.1'
|
|
|
|
implementation 'com.android.support:appcompat-v7:27.1.1'
|
|
|
|
implementation 'com.android.support:gridlayout-v7:27.1.1'
|
|
|
|
implementation 'com.android.support:support-annotations:27.1.1'
|
|
|
|
implementation 'com.android.support:recyclerview-v7:27.1.1'
|
|
|
|
implementation 'com.android.support:cardview-v7:27.1.1'
|
|
|
|
implementation 'com.android.support:design:27.1.1'
|
|
|
|
implementation 'com.android.support:support-vector-drawable:27.1.1'
|
2018-06-15 11:35:32 +02:00
|
|
|
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
2018-06-01 11:08:30 +02:00
|
|
|
implementation 'com.android.support:palette-v7:27.1.1'
|
|
|
|
implementation 'com.android.support:preference-v14:27.1.1'
|
|
|
|
|
|
|
|
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
|
|
|
|
implementation 'com.google.zxing:core:3.3.2'
|
2018-08-07 17:20:32 +02:00
|
|
|
implementation 'info.guardianproject.netcipher:netcipher:2.0.0-beta1'
|
2018-06-01 11:08:30 +02:00
|
|
|
implementation 'info.guardianproject.panic:panic:0.5'
|
|
|
|
implementation 'commons-io:commons-io:2.5'
|
|
|
|
implementation 'commons-net:commons-net:3.5'
|
|
|
|
implementation 'ch.acra:acra:4.9.1'
|
|
|
|
implementation 'io.reactivex:rxjava:1.1.0'
|
|
|
|
implementation 'io.reactivex:rxandroid:0.23.0'
|
|
|
|
implementation 'com.hannesdorfmann:adapterdelegates3:3.0.1'
|
|
|
|
implementation 'com.ashokvarma.android:bottom-navigation-bar:2.0.4'
|
|
|
|
|
|
|
|
implementation 'com.fasterxml.jackson.core:jackson-core:2.8.7'
|
|
|
|
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.8.7'
|
|
|
|
implementation 'com.fasterxml.jackson.core:jackson-databind:2.8.7'
|
|
|
|
|
|
|
|
implementation 'org.bouncycastle:bcprov-jdk15on:1.59'
|
2018-05-30 17:44:21 +02:00
|
|
|
fullImplementation 'org.bouncycastle:bcpkix-jdk15on:1.59'
|
|
|
|
fullImplementation 'cc.mvdan.accesspoint:library:0.2.0'
|
|
|
|
fullImplementation 'org.jmdns:jmdns:3.5.3'
|
|
|
|
fullImplementation 'org.nanohttpd:nanohttpd:2.3.1'
|
2018-06-01 11:08:30 +02:00
|
|
|
|
|
|
|
testImplementation 'org.robolectric:robolectric:3.8'
|
2018-05-30 17:44:21 +02:00
|
|
|
testImplementation 'org.bouncycastle:bcprov-jdk15on:1.59'
|
2018-06-01 11:08:30 +02:00
|
|
|
testImplementation 'junit:junit:4.12'
|
|
|
|
testImplementation 'org.mockito:mockito-core:2.7.22'
|
|
|
|
|
|
|
|
androidTestImplementation 'com.android.support:support-annotations:25.3.1'
|
|
|
|
androidTestImplementation 'com.android.support.test:runner:0.5'
|
|
|
|
androidTestImplementation 'com.android.support.test:rules:0.5'
|
|
|
|
}
|
|
|
|
|
2018-05-30 14:44:09 +02:00
|
|
|
tasks.whenTaskAdded { task ->
|
|
|
|
if (task.name.startsWith("lintBasic")) {
|
|
|
|
android.lintOptions.abortOnError = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-30 10:35:19 +01:00
|
|
|
checkstyle {
|
2016-10-31 14:19:30 +00:00
|
|
|
toolVersion = '7.2'
|
2015-11-30 10:35:19 +01:00
|
|
|
}
|
|
|
|
|
2015-10-08 16:50:07 +02:00
|
|
|
task checkstyle(type: Checkstyle) {
|
|
|
|
configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")
|
2016-03-31 12:21:57 +01:00
|
|
|
source 'src/main/java', 'src/test/java', 'src/androidTest/java'
|
2015-10-08 16:50:07 +02:00
|
|
|
include '**/*.java'
|
|
|
|
|
|
|
|
classpath = files()
|
|
|
|
}
|
2015-10-08 17:11:22 +02:00
|
|
|
|
2016-03-01 17:30:48 +00:00
|
|
|
pmd {
|
2016-07-31 16:41:25 +02:00
|
|
|
toolVersion = '5.5.1'
|
2016-03-01 17:30:48 +00:00
|
|
|
consoleOutput = true
|
|
|
|
}
|
|
|
|
|
2016-09-28 21:58:27 +01:00
|
|
|
task pmdMain(type: Pmd) {
|
|
|
|
dependsOn 'assembleDebug'
|
2016-06-09 09:55:12 +10:00
|
|
|
ruleSetFiles = files("${project.rootDir}/config/pmd/rules.xml", "${project.rootDir}/config/pmd/rules-main.xml")
|
2016-04-23 15:59:04 +01:00
|
|
|
ruleSets = [] // otherwise defaults clash with the list in rules.xml
|
2016-06-09 09:55:12 +10:00
|
|
|
source 'src/main/java'
|
|
|
|
include '**/*.java'
|
2018-04-19 16:19:21 +02:00
|
|
|
exclude '**/kellinwood/**/*.java'
|
2016-06-09 09:55:12 +10:00
|
|
|
}
|
|
|
|
|
2016-09-28 21:58:27 +01:00
|
|
|
task pmdTest(type: Pmd) {
|
|
|
|
dependsOn 'assembleDebug'
|
2016-06-09 09:55:12 +10:00
|
|
|
ruleSetFiles = files("${project.rootDir}/config/pmd/rules.xml", "${project.rootDir}/config/pmd/rules-test.xml")
|
|
|
|
ruleSets = [] // otherwise defaults clash with the list in rules.xml
|
|
|
|
source 'src/test/java', 'src/androidTest/java'
|
2016-04-13 13:18:20 +01:00
|
|
|
include '**/*.java'
|
2016-03-01 17:30:48 +00:00
|
|
|
}
|
|
|
|
|
2016-06-09 09:55:12 +10:00
|
|
|
task pmd(dependsOn: [pmdMain, pmdTest]) {}
|