Files
open-keychain/OpenKeychain/build.gradle

252 lines
12 KiB
Groovy
Raw Normal View History

apply plugin: 'com.android.application'
2015-03-02 17:23:06 +01:00
apply plugin: 'witness'
2015-06-11 12:54:15 +02:00
apply plugin: 'jacoco'
2015-06-11 12:58:21 +02:00
apply plugin: 'com.github.kt3k.coveralls'
dependencies {
2014-06-04 10:22:05 +02:00
// NOTE: Always use fixed version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information
2015-03-02 18:50:38 +01:00
// NOTE: libraries are pinned to a specific build, see below
2014-06-04 10:21:28 +02:00
2015-03-02 18:50:38 +01:00
// from local Android SDK
2015-06-29 15:08:26 +02:00
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
2015-04-25 23:40:26 +02:00
compile 'com.android.support:cardview-v7:22.1.0'
2015-06-11 00:35:58 +02:00
// Unit tests in the local JVM with Robolectric
2015-06-11 00:31:41 +02:00
// https://developer.android.com/training/testing/unit-testing/local-unit-tests.html
// https://github.com/nenick/AndroidStudioAndRobolectric
// http://www.vogella.com/tutorials/Robolectric/article.html
testCompile 'junit:junit:4.12'
2015-06-11 00:35:58 +02:00
testCompile 'org.robolectric:robolectric:3.0-rc3'
2015-03-23 20:17:30 +01:00
// UI testing with Espresso
2015-06-13 21:50:57 +02:00
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
2015-06-20 20:04:33 +02:00
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2'
2015-06-13 21:50:57 +02:00
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
2015-04-24 00:06:35 +05:30
// Temporary workaround for bug: https://code.google.com/p/android-test-kit/issues/detail?id=136
// from https://github.com/googlesamples/android-testing/blob/master/build.gradle#L21
configurations.all {
2015-06-29 15:08:26 +02:00
resolutionStrategy.force 'com.android.support:support-annotations:22.2.0'
}
2015-03-02 18:50:38 +01:00
// JCenter etc.
compile 'com.eftimoff:android-patternview:1.0.1@aar'
2015-04-14 00:48:45 +02:00
compile 'com.journeyapps:zxing-android-embedded:2.3.0@aar'
compile 'com.journeyapps:zxing-android-integration:2.3.0@aar'
2015-03-23 20:17:30 +01:00
compile 'com.google.zxing:core:3.2.0'
2015-03-02 18:50:38 +01:00
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
2015-03-23 20:17:30 +01:00
compile 'com.getbase:floatingactionbutton:1.9.0'
2015-03-23 01:11:11 +01:00
compile 'org.commonjava.googlecode.markdown4j:markdown4j:2.2-cj-1.0'
2015-06-16 00:08:17 +02:00
compile 'com.splitwise:tokenautocomplete:1.3.3@aar'
2015-04-14 00:48:45 +02:00
compile 'se.emilsjolander:stickylistheaders:2.6.0'
2015-04-14 00:06:05 +02:00
compile 'org.sufficientlysecure:html-textview:1.1'
compile 'com.mikepenz.materialdrawer:library:2.8.2@aar'
compile 'com.mikepenz.iconics:library:0.9.1@aar'
compile 'com.mikepenz.iconics:octicons-typeface:2.2.0@aar'
compile 'com.mikepenz.iconics:meteocons-typeface:1.1.1@aar'
compile 'com.mikepenz.iconics:community-material-typeface:1.0.0@aar'
2015-05-10 03:39:19 +02:00
compile 'com.nispok:snackbar:2.10.8'
2015-06-07 02:19:03 +05:30
compile 'com.squareup.okhttp:okhttp:2.4.0'
2015-03-23 20:17:30 +01:00
2015-03-02 18:50:38 +01:00
// libs as submodules
2015-05-06 00:08:04 +02:00
compile project(':extern:openpgp-api-lib:openpgp-api')
compile project(':extern:openkeychain-api-lib:openkeychain-intents')
compile project(':extern:spongycastle:core')
compile project(':extern:spongycastle:pg')
compile project(':extern:spongycastle:pkix')
compile project(':extern:spongycastle:prov')
2014-06-23 22:02:18 +02:00
compile project(':extern:minidns')
compile project(':extern:KeybaseLib:Lib')
2014-09-04 11:30:36 +02:00
compile project(':extern:safeslinger-exchange')
}
2015-03-02 17:23:06 +01:00
// Output of ./gradlew -q calculateChecksums
// Comment out the libs referenced as git submodules!
dependencyVerification {
verify = [
2015-06-29 15:08:26 +02:00
'com.android.support:support-v4:7bb6e40a18774aa2595e4d8f9fe0ae14e61670f71a1279272fb0b79b8be71180',
'com.android.support:appcompat-v7:2d5867698410b41f75140c91d6c1e58da74ae0f97baf6e0bdd1f7cc1017ceb2c',
'com.android.support:design:41ff5f700d1bf8c190e1d3ac33582f92ad6e1f3b1080c8b8e2ac4f7b703be76a',
'com.android.support:recyclerview-v7:3a8da14585fa1c81f06e7cef4d93a7641f0323d8f984ff9a7bd7a6e416b46888',
2015-04-25 23:40:26 +02:00
'com.android.support:cardview-v7:8dc99af71fec000baa4470c3907755264f15f816920861bc015b2babdbb49807',
2015-03-23 20:17:30 +01:00
'com.eftimoff:android-patternview:cec80e7265b8d8278b3c55b5fcdf551e4600ac2c8bf60d8dd76adca538af0b1e',
2015-04-14 00:48:45 +02:00
'com.journeyapps:zxing-android-embedded:702a4f58154dbd9baa80f66b6a15410f7a4d403f3e73b66537a8bfb156b4b718',
'com.journeyapps:zxing-android-integration:562737821b6d34c899b6fd2234ce0a8a31e02ff1fd7c59f6211961ce9767c7c8',
2015-03-23 20:17:30 +01:00
'com.google.zxing:core:7fe5a8ff437635a540e56317649937b768b454795ce999ed5f244f83373dee7b',
'com.jpardogo.materialtabstrip:library:c6ef812fba4f74be7dc4a905faa4c2908cba261a94c13d4f96d5e67e4aad4aaa',
'com.getbase:floatingactionbutton:052aa2a94e49e5dccc97cb99f2add87e8698b84859f0e3ac181100c0bc7640ca',
'org.commonjava.googlecode.markdown4j:markdown4j:e952e825d29e1317d96f79f346bfb6786c7c5eef50bd26e54a80823704b62e13',
'com.splitwise:tokenautocomplete:20bee71cc59b3828eb000b684d46ddf738efd56b8fee453a509cd16fda42c8cb',
2015-04-14 00:48:45 +02:00
'se.emilsjolander:stickylistheaders:8c05981ec5725be33f7cee5e68c13f3db49cd5c75f1aaeb04024920b1ef96ad4',
2015-04-14 00:06:05 +02:00
'org.sufficientlysecure:html-textview:ca24b1522be88378634093815ce9ff1b4920c72e7513a045a7846e14069ef988',
'com.mikepenz.materialdrawer:library:970317ed1a3cb96317f7b8d62ff592b3103eb46dfd68d9b244e7143623dc6d7a',
'com.mikepenz.iconics:library:4698a36ee4c2af765d0a85779c61474d755b90d66a59020105b6760a8a909e9e',
'com.mikepenz.iconics:octicons-typeface:67ed7d456a9ce5f5307b85f955797bfb3dd674e2f6defb31c6b8bbe2ede290be',
'com.mikepenz.iconics:meteocons-typeface:39a8a9e70cd8287cdb119af57a672a41dd09240dba6697f5a0dbda1ccc33298b',
'com.mikepenz.iconics:community-material-typeface:f1c5afee5f0f10d66beb3ed0df977246a02a9c46de4e05d7c0264bcde53b6b7f',
2015-05-10 03:39:19 +02:00
'com.nispok:snackbar:80bebc8e5d8b3d728cd5f2336e2d0c1cc2a6b7dc4b55d36acd6b75a78265590a',
//'open-keychain.extern.openpgp-api-lib:openpgp-api:cbac23f4dcfdd8cf580e6dcafaaeb8958894be9765b16058b30df173af714ce0',
//'open-keychain.extern.openkeychain-api-lib:openkeychain-intents:24c5403f1225597489924d31a2d3638f5800f5c06ac0adbef3b90a43c5e41b92',
//'open-keychain.extern.spongycastle:core:2cccd7471684eab9c3bc2d74e117d27dd2b10b9edbbf85d2718fc2dfb4c3fbe6',
//'open-keychain.extern.spongycastle:pg:9b333ccd06f8ec5d3857a8c516f83b0d1bff4d9b0208809c1468300ebbe2cd01',
//'open-keychain.extern.spongycastle:pkix:534001eca2a44ca4277a93c4293040bf4137c81f2c321f0cd92411acd7762bc4',
//'open-keychain.extern.spongycastle:prov:86c39b96a9604a6633ba4c47fac6f46b829d2a580dfac33514d5c2eaceda46d0',
//'open-keychain.extern:minidns:cad64ffcda40e2351b6a7429fbfb60e32ff167e852503fff4fa097cde134957a',
//'open-keychain.extern.KeybaseLib:Lib:a81380c89bb5f080d4f13cb24172a19d8f0031c32fa2ea0e346c54d215849900',
//'open-keychain.extern:safeslinger-exchange:5701b33044f5914ec58046183e900576c1285ad191a8a04d59c7600d31f36361',
2015-06-29 15:08:26 +02:00
'com.android.support:support-annotations:beac5cae60bdb597df9af9c916f785c2f71f8c8ae4be9a32d4298dea85496a42',
2015-03-02 17:23:06 +01:00
]
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 15
2015-03-23 20:17:30 +01:00
targetSdkVersion 22
2015-06-30 13:36:27 +02:00
versionCode 33000
versionName "3.3"
2015-06-10 22:35:06 +02:00
applicationId "org.sufficientlysecure.keychain"
2015-06-17 18:30:58 +02:00
// the androidjunitrunner is broken regarding coverage, see here:
// https://code.google.com/p/android/issues/detail?id=170607
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// this workaround runner fixes the coverage problem, BUT doesn't work
// with android studio single test execution. use it to generate coverage
// data, but keep the other one otherwis
// testInstrumentationRunner "org.sufficientlysecure.keychain.JacocoWorkaroundJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
2015-05-10 04:58:44 +02:00
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// Reference them in the java files with e.g. BuildConfig.ACCOUNT_TYPE.
buildConfigField "String", "ACCOUNT_TYPE", "\"org.sufficientlysecure.keychain.account\""
// Reference them in .xml files.
resValue "string", "account_type", "org.sufficientlysecure.keychain.account"
}
2015-06-10 22:35:06 +02:00
2015-06-11 00:31:41 +02:00
debug {
applicationIdSuffix ".debug"
// Reference them in the java files with e.g. BuildConfig.ACCOUNT_TYPE.
buildConfigField "String", "ACCOUNT_TYPE", "\"org.sufficientlysecure.keychain.debug.account\""
// Reference them in .xml files.
resValue "string", "account_type", "org.sufficientlysecure.keychain.debug.account"
2015-06-11 12:54:15 +02:00
// Enable code coverage (Jacoco)
2015-06-14 12:12:28 +02:00
testCoverageEnabled true
2015-06-11 00:31:41 +02:00
}
2015-05-10 04:58:44 +02:00
}
2013-09-09 21:11:16 +02:00
/*
* To sign release build, create file gradle.properties in ~/.gradle/ with this content:
*
* signingStoreLocation=/home/key.store
* signingStorePassword=xxx
* signingKeyAlias=alias
* signingKeyPassword=xxx
*/
if (project.hasProperty('signingStoreLocation') &&
project.hasProperty('signingStorePassword') &&
project.hasProperty('signingKeyAlias') &&
project.hasProperty('signingKeyPassword')) {
println "Found sign properties in gradle.properties! Signing build…"
2015-03-23 20:17:30 +01:00
2013-09-09 21:11:16 +02:00
signingConfigs {
2013-08-15 18:07:54 +05:30
release {
2013-09-09 21:11:16 +02:00
storeFile file(signingStoreLocation)
storePassword signingStorePassword
keyAlias signingKeyAlias
keyPassword signingKeyPassword
2013-08-15 18:07:54 +05:30
}
}
2013-09-09 21:11:16 +02:00
buildTypes.release.signingConfig = signingConfigs.release
} else {
buildTypes.release.signingConfig = null
}
2015-03-23 20:17:30 +01:00
// NOTE: Lint is disabled because it slows down builds,
// to enable it comment out the code at the bottom of this build.gradle
lintOptions {
// Do not abort build if lint finds errors
abortOnError false
checkAllWarnings true
2014-03-10 14:59:15 -04:00
htmlReport true
2014-09-04 11:30:36 +02:00
htmlOutput file('lint-report.html')
}
2015-03-23 20:17:30 +01:00
// Disable preDexing, causes com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000) on some systems
dexOptions {
preDexLibraries = false
}
2015-04-24 00:06:35 +05:30
packagingOptions {
exclude 'LICENSE.txt'
}
}
2015-06-11 12:54:15 +02:00
2015-06-14 15:05:47 +02:00
// apply plugin: 'spoon'
2015-06-11 12:54:15 +02:00
task jacocoTestReport(type:JacocoReport) {
group = "Reporting"
description = "Generate Jacoco coverage reports"
classDirectories = fileTree(
dir: "${buildDir}/intermediates/classes/debug",
excludes: ['**/R.class',
'**/R$*.class',
'**/*$ViewInjector*.*',
'**/BuildConfig.*',
'**/Manifest*.*']
)
sourceDirectories = files("${buildDir.parent}/src/main/java")
additionalSourceDirs = files([
"${buildDir}/generated/source/buildConfig/debug",
"${buildDir}/generated/source/r/debug"
])
executionData = files([
"${buildDir}/jacoco/testDebug.exec",
"${buildDir}/outputs/code-coverage/connected/coverage.ec"
])
2015-06-11 12:54:15 +02:00
reports {
xml.enabled = true
html.enabled = true
}
}
2015-06-11 13:12:45 +02:00
// Fix for: No report file available: [/home/travis/build/open-keychain/open-keychain/OpenKeychain/build/reports/cobertura/coverage.xml, /home/travis/build/open-keychain/open-keychain/OpenKeychain/build/reports/jacoco/test/jacocoTestReport.xml]
coveralls {
jacocoReportPath 'build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml'
}
// NOTE: This disables Lint!
tasks.whenTaskAdded { task ->
2014-09-04 11:30:36 +02:00
if (task.name.contains('lint')) {
task.enabled = false
}
}