Files
open-keychain/OpenKeychain/build.gradle

325 lines
16 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
2016-02-29 23:13:51 +01:00
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
2015-06-11 20:03:59 +02:00
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
// http://robolectric.org/getting-started/
// http://www.vogella.com/tutorials/Robolectric/article.html
testCompile 'junit:junit:4.12'
testCompile ('org.robolectric:robolectric:3.0') {
exclude group: 'org.bouncycastle', module: 'bcprov-jdk16'
}
2015-11-13 14:59:45 +01:00
testCompile 'org.mockito:mockito-core:1.10.19'
2015-03-23 20:17:30 +01:00
// UI testing with Espresso
2016-01-03 20:45:31 +01:00
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.1'
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.1') {
2015-06-13 21:50:57 +02:00
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 {
2016-02-29 23:13:51 +01:00
resolutionStrategy.force 'com.android.support:support-annotations:23.2.0'
}
2015-03-02 18:50:38 +01:00
// JCenter etc.
2016-01-03 20:45:31 +01:00
compile 'com.eftimoff:android-patternview:1.0.5@aar'
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
2016-01-03 20:45:31 +01:00
compile 'com.google.zxing:core:3.2.1'
compile 'com.jpardogo.materialtabstrip:library:1.1.0'
compile 'com.getbase:floatingactionbutton:1.10.1'
2015-03-23 01:11:11 +01:00
compile 'org.commonjava.googlecode.markdown4j:markdown4j:2.2-cj-1.0'
2016-01-03 20:45:31 +01:00
compile 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
compile 'com.splitwise:tokenautocomplete:2.0.7@aar'
compile 'se.emilsjolander:stickylistheaders:2.7.0'
compile 'org.sufficientlysecure:html-textview:1.3'
2016-02-09 20:48:24 +01:00
compile 'org.sufficientlysecure:donations:2.4'
compile 'com.nispok:snackbar:2.11.0'
2016-03-12 19:32:36 +01:00
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.2.0'
2015-08-10 14:35:15 +02:00
compile 'org.apache.james:apache-mime4j-core:0.7.2'
compile 'org.apache.james:apache-mime4j-dom:0.7.2'
compile 'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0'
2016-02-29 23:13:51 +01:00
compile 'com.cocosw:bottomsheet:1.3.0@aar'
2015-03-23 20:17:30 +01:00
2016-02-09 20:48:24 +01:00
// Material Drawer
compile 'com.mikepenz:materialdrawer:4.6.3@aar'
compile 'com.mikepenz:materialize:0.5.1'
compile 'com.mikepenz:iconics-core:2.5.3@aar'
compile 'com.mikepenz:google-material-typeface:2.2.0.1@aar'
compile 'com.mikepenz:fontawesome-typeface:4.5.0.1@aar'
compile 'com.mikepenz:community-material-typeface:1.3.41.1@aar'
// Nordpol
2016-01-27 16:40:30 +01:00
compile 'com.fidesmo:nordpol-android:0.1.18'
2015-03-02 18:50:38 +01:00
// libs as submodules
compile project(':openpgp-api-lib')
compile project(':openkeychain-api-lib')
2016-02-09 00:24:46 +01:00
compile project(':extern:bouncycastle:core')
compile project(':extern:bouncycastle:pg')
compile project(':extern:bouncycastle:prov')
2014-06-23 22:02:18 +02:00
compile project(':extern:minidns')
2016-04-12 19:42:54 +02:00
compile project(':KeybaseLib')
compile project(':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 = [
2016-02-29 23:13:51 +01:00
'com.android.support:support-v4:992666398b80724a2f95ea3d7bf7c3d94fb810dcba7ae1aa6e38c0d6120d2603',
'com.android.support:appcompat-v7:14ab04eb2e3f302a082b79c308f6283d21909d1feb831a4e117cdacdad70adb7',
'com.android.support:design:e7f2a383ba675cf65d834f27079630a1e373f2f3a08330bec6a7c798ef50b3b2',
'com.android.support:recyclerview-v7:81aad9ff4104a20d8d5cda49dbbe0f2925e7dcd607a689374db843c6f2eca20a',
'com.android.support:cardview-v7:b2c2c070a78fbf7683ab4d84b23f9eecf2af3848f126775d048ae62238b55aed',
'com.eftimoff:android-patternview:594dde382fb9a445ef0c92d614f6f127727ce699f124de8167929e10f298bf8b',
'com.journeyapps:zxing-android-embedded:afe4cd51d95ba0fd3a4bfe08c5a160bd32602aa174d511600ac824b6de4c79f1',
2016-02-29 23:13:51 +01:00
'com.google.zxing:core:b4d82452e7a6bf6ec2698904b332431717ed8f9a850224f295aec89de80f2259',
'com.jpardogo.materialtabstrip:library:24d19232b319f8c73e25793432357919a7ed972186f57a3b2c9093ea74ad8311',
'com.getbase:floatingactionbutton:3edefa511aac4d90794c7b0496aca59cff2eee1e32679247b4f85acbeee05240',
'org.commonjava.googlecode.markdown4j:markdown4j:e952e825d29e1317d96f79f346bfb6786c7c5eef50bd26e54a80823704b62e13',
'org.ocpsoft.prettytime:prettytime:ef7098d973ae78b57d1a22dc37d3b8a771bf030301300e24055d676b6cdc5e75',
'com.splitwise:tokenautocomplete:f56239588390f103b270b7c12361d99b06313a5a0410dc7f66e241ac4baf9baa',
2016-02-29 23:13:51 +01:00
'se.emilsjolander:stickylistheaders:a08ca948aa6b220f09d82f16bbbac395f6b78897e9eeac6a9f0b0ba755928eeb',
'org.sufficientlysecure:donations:96f8197bab26dfe41900d824f10f8f1914519cd62eedb77bdac5b223eccdf0a6',
'org.sufficientlysecure:html-textview:39048e35894e582adada388e6c00631803283f8defed8e07ad58a5f284f272ee',
2016-03-12 19:32:36 +01:00
'com.squareup.okhttp3:okhttp:a41cdb7b024c56436a21e38f00b4d12e3b7e01451ffe6c4f545acba805bba03b',
'com.squareup.okhttp3:okhttp-urlconnection:7d6598a6665c166e2d4b78956a96056b9be7de192b3c923ccf4695d08e580833',
2016-02-29 23:13:51 +01:00
'com.nispok:snackbar:46b5eb9d630d329e13c2ce00ee9fb115ffb66c23c72cff32ee97eedd76824c6f',
'org.apache.james:apache-mime4j-core:4d7434c68f94b81a253c12f28e6bbb4d6239c361d6086a46e22e594bb43ac660',
'org.thoughtcrime.ssl.pinning:AndroidPinning:afa1d74e699257fa75cb109ff29bac50726ef269c6e306bdeffe8223cee06ef4',
'org.apache.james:apache-mime4j-dom:7e6b06ee164a1c21b7e477249ea0b74a18fddce44764e5764085f58dd8c34633',
'com.mikepenz:materialdrawer:4e2644f454cc2ce48b956536d3339957c3f592adb2e0b6dad72d477da29f7677',
'com.cocosw:bottomsheet:4af6112a7f4cad4e2b70e5fdf1edc39f51275523a0f53011a012837dc103e597',
'com.mikepenz:iconics-core:d2495547db9d881168b1b502b1934f6a000ed5086c6c6a7114f3bbcbbb7ec306',
'com.mikepenz:materialize:2457dbe0b874a422c0a21bc6716cf5af1d5a8d39387857ff7c20855ab5543bf8',
'com.mikepenz:fontawesome-typeface:69cb09934a83bac607e78a29459868d537f766224b4a65a042d1f84c98c7b05d',
'com.mikepenz:google-material-typeface:48b2712de87d542e9b050846e9f602238a367f38e2d5e8ea4557c5b12adfcbec',
'com.fidesmo:nordpol-android:56f43fe2b1676817bcb4085926de14a08282ef6729c855c198d81aec62b20d65',
'com.mikepenz:community-material-typeface:990acfcfb892a733d36748fe29176bd61dd5ab34bc8ca1c591200e639d955b99',
// 'OpenKeychain.extern.bouncycastle:core:5321ccaae5c49cd681d6cc222252d8fc4fe033978a3c79ae63f842e701bb5197',
// 'OpenKeychain.extern.openpgp-api-lib:openpgp-api:e7121ea04a39bdc62e56db30e273de3c53c1e3baf21416cfeb551e6652bef639',
// 'OpenKeychain.extern.openkeychain-api-lib:openkeychain-intents:bd88737b61c0efa8cf9fc2cf3da2e2b827c77e4c0b5342b7a665bcc58daca17f',
// 'OpenKeychain.extern.bouncycastle:prov:7fe09ee4fc9e7653f430f1fa30eacb2ef594f4cc3f1b27edcce17da27af7af10',
// 'OpenKeychain.extern.bouncycastle:pg:1efe7abff1d94630064606f1a1c8b55e41a57953d3792524b2a07bc9821b3802',
// 'OpenKeychain.extern.safeslinger-exchange:safeslinger-exchange:202943c4c9affdf52ee85840b0ff65ceea12b7c3f4e5f1e378e906815769613e',
2016-02-29 23:13:51 +01:00
'com.android.support:support-annotations:7f21659b084da073b77b6f7fe7ab250c4f23346238d4efdbbbb937e017ae4693',
// 'OpenKeychain.extern:minidns:c026deb65796d29d347ee6a0d61daf4e8cd97e714eb540386dc0764bddf96cd3',
// 'OpenKeychain.extern.KeybaseLib:Lib:83be9cc36fd6807dbec5b4ba7e3c2c1287a70e43bbe564abf20d096299848b73',
2016-02-29 23:13:51 +01:00
'com.android.support:animated-vector-drawable:4d8366192dedc8ca9e6ff62e9be9ba6145166554d61befc9df312e8328836f55',
'com.android.support:support-vector-drawable:0f43fc47b0d2797c4e1851aba61ab87a4fd33323348c2bd022821aaac052a266',
'com.squareup.okio:okio:114bdc1f47338a68bcbc95abf2f5cdc72beeec91812f2fcd7b521c1937876266',
'com.fidesmo:nordpol-core:3de58e850a00bba5b4d3a604d1399bcd89f695ea191ec0b03a57222e18062d15',
2015-03-02 17:23:06 +01:00
]
}
2015-10-29 23:01:16 +01:00
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
2015-10-26 20:53:32 +01:00
defaultConfig {
minSdkVersion 15
2015-10-26 20:53:32 +01:00
targetSdkVersion 23
2016-04-29 13:16:32 +02:00
versionCode 39510
versionName "3.9.5"
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-06-11 20:03:59 +02:00
2016-01-03 23:09:35 +01:00
testOptions.unitTests.all {
// log results of tests to console, useful for travis
testLogging {
events 'passed', 'skipped', 'failed' //, 'standardOut', 'standardError'
}
}
2015-05-10 04:58:44 +02:00
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2015-06-11 20:03:59 +02:00
// Reference them in the java files with e.g. BuildConfig.ACCOUNT_TYPE.
buildConfigField "String", "ACCOUNT_TYPE", "\"org.sufficientlysecure.keychain.account\""
buildConfigField "String", "PROVIDER_CONTENT_AUTHORITY", "\"org.sufficientlysecure.keychain.provider\""
// Reference them in .xml files.
resValue "string", "account_type", "org.sufficientlysecure.keychain.account"
resValue "string", "provider_content_authority", "org.sufficientlysecure.keychain.provider"
2015-10-26 12:29:05 +01:00
// Github API
buildConfigField "String", "GITHUB_CLIENT_ID", "\"c942cd81844d94e7e41b\""
buildConfigField "String", "GITHUB_CLIENT_SECRET", "\"f1dd17e70a0614abbd9310b00a310e23c6c8edff\""
}
2015-06-10 22:35:06 +02:00
2015-06-11 00:31:41 +02:00
debug {
applicationIdSuffix ".debug"
2015-06-11 20:03:59 +02:00
// Reference them in the java files with e.g. BuildConfig.ACCOUNT_TYPE.
buildConfigField "String", "ACCOUNT_TYPE", "\"org.sufficientlysecure.keychain.debug.account\""
buildConfigField "String", "PROVIDER_CONTENT_AUTHORITY", "\"org.sufficientlysecure.keychain.debug.provider\""
// Reference them in .xml files.
resValue "string", "account_type", "org.sufficientlysecure.keychain.debug.account"
resValue "string", "provider_content_authority", "org.sufficientlysecure.keychain.debug.provider"
2015-06-11 20:03:59 +02:00
2015-10-26 12:29:05 +01:00
// Github API
buildConfigField "String", "GITHUB_CLIENT_ID", "\"c942cd81844d94e7e41b\""
buildConfigField "String", "GITHUB_CLIENT_SECRET", "\"f1dd17e70a0614abbd9310b00a310e23c6c8edff\""
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
}
2016-02-09 20:48:24 +01:00
productFlavors {
google {
buildConfigField "boolean", "DONATIONS_GOOGLE", "true"
buildConfigField "String", "GOOGLE_PLAY_PUBKEY", "\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwX9SOQ/EL4u5pvbYmYMagN5DDenuSaMaVs2cVPzqxMaIHp6/9/nGuzj2/CpcB4ASd2vvfLlE9tZRkPmFTULWc4Sp4OR+JenQufZZr7Y8WGPkFyqd+dOxhIqKKLtH1QuqSyhby3gEMlWzydJY3rHXlH2Bpu65Uroawq76nynnELXNlzsCM231XWgj4HA87qxv9hSWLCpu16wKxZIX3d6mwZLZmGF+xYJAzVr291oDYYl+h6BDoIcAfmQFsv5MexNwBFO+TLVrvL0e5qdGHZxwwD1/68VSY8FxAEfM+yq7jovdVSdcXlJQjZrV5TRDdFWrtEB6njGA3YZWXP6B6MMMoQIDAQAB\""
buildConfigField "String", "PAYPAL_USER", "null"
buildConfigField "String", "PAYPAL_CURRENCY_CODE", "null"
buildConfigField "String", "BITCOIN_ADDRESS", "null"
}
fdroid {
buildConfigField "boolean", "DONATIONS_GOOGLE", "false"
buildConfigField "String", "GOOGLE_PLAY_PUBKEY", "null"
buildConfigField "String", "PAYPAL_USER", "\"dominik@dominikschuermann.de\""
buildConfigField "String", "PAYPAL_CURRENCY_CODE", "\"EUR\""
buildConfigField "String", "BITCOIN_ADDRESS", "\"1JZfAKTbTU5LJTkDELhPUF4Xa6VstEZgz6\""
}
}
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
dexOptions {
incremental = true
2015-08-10 14:35:15 +02:00
// Disable preDexing, causes com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000) on some systems
preDexLibraries = false
jumboMode = true
Merge branch 'linked-identities' (and fix OperationHelper ids) Merge Linked Identities. Also includes an important fix for OperationHelper ids, which had an error in the bit mask logic. Conflicts: Graphics/update-drawables.sh OpenKeychain/build.gradle OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/CertifyActionsParcel.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportFragment.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/KeyAdapter.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertifyKeySpinner.java OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java OpenKeychain/src/main/res/anim/fade_in.xml OpenKeychain/src/main/res/anim/fade_out.xml OpenKeychain/src/main/res/layout/decrypt_text_fragment.xml OpenKeychain/src/main/res/layout/encrypt_decrypt_overview_fragment.xml OpenKeychain/src/main/res/layout/view_key_fragment.xml OpenKeychain/src/main/res/menu/key_view.xml OpenKeychain/src/main/res/values/strings.xml OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/CertifyOperationTest.java README.md
2015-08-29 13:28:56 +02:00
javaMaxHeapSize "2g"
}
2015-04-24 00:06:35 +05:30
packagingOptions {
exclude 'LICENSE.txt'
2015-07-06 11:06:10 +02:00
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
2015-08-10 14:35:15 +02:00
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
2015-07-06 11:06:10 +02:00
exclude '.readme'
2015-04-24 00:06:35 +05:30
}
}
2015-06-11 12:54:15 +02:00
2015-06-14 15:05:47 +02:00
// apply plugin: 'spoon'
2016-02-09 21:02:43 +01:00
task jacocoTestReport(type:JacocoReport, dependsOn: "testFdroidDebugUnitTest") {
2015-06-11 12:54:15 +02:00
group = "Reporting"
description = "Generate Jacoco coverage reports"
classDirectories = fileTree(
dir: "${buildDir}/intermediates/classes/debug",
excludes: ['**/R.class',
'**/R$*.class',
'**/*$ViewInjector*.*',
'**/BuildConfig.*',
2015-10-08 18:01:40 +02:00
'**/Manifest*.*',
'**/*Activity*.*',
'**/*Fragment*.*']
2015-06-11 12:54:15 +02:00
)
sourceDirectories = files("${buildDir.parent}/src/main/java")
additionalSourceDirs = files([
"${buildDir}/generated/source/buildConfig/debug",
"${buildDir}/generated/source/r/debug"
])
2015-10-08 18:01:40 +02:00
executionData = fileTree(dir: "${buildDir}/jacoco", include: "**/*.exec")
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
}
}