open-keychain/OpenKeychain/build.gradle

268 lines
11 KiB
Groovy
Raw Normal View History

apply plugin: 'com.android.application'
apply plugin: 'com.squareup.sqldelight'
dependencies {
2016-12-04 20:12:37 +01:00
// from local Android SDK
2019-11-15 12:09:08 +01:00
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
2020-05-30 19:21:11 +02:00
implementation 'androidx.recyclerview:recyclerview:1.1.0'
2019-11-15 12:09:08 +01:00
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
2015-06-11 20:03:59 +02:00
2015-03-02 18:50:38 +01:00
// JCenter etc.
2019-11-15 11:38:30 +01:00
implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
2020-05-31 13:09:21 +02:00
implementation 'com.google.zxing:core:3.4.0'
2019-11-15 11:38:30 +01:00
implementation 'org.commonjava.googlecode.markdown4j:markdown4j:2.2-cj-1.1'
implementation 'org.sufficientlysecure:donations:2.5'
2019-11-15 13:37:12 +01:00
implementation 'com.squareup.okhttp3:okhttp:3.13.1'
2019-11-15 11:38:30 +01:00
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.9.1'
2019-11-15 13:37:12 +01:00
implementation 'org.apache.james:apache-mime4j-core:0.8.1'
implementation 'org.apache.james:apache-mime4j-dom:0.8.1'
2016-11-30 15:51:32 +01:00
// UI
2019-11-15 11:38:30 +01:00
implementation 'org.sufficientlysecure:html-textview:3.1'
implementation 'com.jpardogo.materialtabstrip:library:1.1.1'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.nispok:snackbar:2.11.0'
2019-11-15 12:09:08 +01:00
implementation 'com.cocosw:bottomsheet:1.5.0@aar'
2016-11-30 15:07:16 +01:00
2016-11-30 15:51:32 +01:00
// RecyclerView
2019-11-15 13:37:12 +01:00
implementation 'eu.davidea:flexible-adapter:5.1.0'
2019-11-15 11:38:30 +01:00
implementation 'eu.davidea:flexible-adapter-ui:1.0.0-b5'
implementation 'eu.davidea:flexible-adapter-livedata:1.0.0-b2'
2015-03-23 20:17:30 +01:00
2016-02-09 20:48:24 +01:00
// Material Drawer
2019-11-15 13:37:12 +01:00
implementation 'com.mikepenz:materialdrawer:6.1.2@aar'
implementation 'com.mikepenz:fastadapter:3.3.0'
implementation 'com.mikepenz:fastadapter-extensions-expandable:3.3.0'
2020-05-31 13:09:21 +02:00
implementation 'com.mikepenz:materialize:1.2.1'
2019-11-15 13:37:12 +01:00
implementation 'com.mikepenz:iconics-core:3.1.0@aar'
2019-11-15 11:38:30 +01:00
implementation 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar'
2019-11-15 13:37:12 +01:00
implementation 'com.mikepenz:fontawesome-typeface:5.3.1.1@aar'
2019-11-15 11:38:30 +01:00
implementation 'com.mikepenz:community-material-typeface:1.5.54.2@aar'
2016-02-09 20:48:24 +01:00
// Nordpol
2019-11-15 11:38:30 +01:00
implementation 'com.fidesmo:nordpol-android:0.1.22'
2015-03-02 18:50:38 +01:00
// libs as submodules
2018-01-20 23:59:41 +01:00
implementation project(':openpgp-api-lib')
implementation project(':nfcsweetspot')
2018-01-20 23:59:41 +01:00
implementation project(':sshauthentication-api')
implementation project(':extern:MaterialChipsInput')
2016-04-29 21:09:20 +02:00
2020-01-23 14:10:39 +01:00
// implementation project(':openkeychain:extern:bouncycastle:core')
2021-01-29 13:29:43 +01:00
implementation 'org.bouncycastle:bcprov-jdk15on:1.68'
2020-01-23 14:10:39 +01:00
implementation project(':extern:bouncycastle:pg')
// implementation project(':openkeychain:extern:bouncycastle:prov')
2020-05-30 19:07:32 +02:00
implementation 'androidx.work:work-runtime:2.3.4'
2018-06-13 13:12:44 +02:00
2016-04-29 21:09:20 +02:00
// Unit tests in the local JVM with Robolectric
// 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
2020-05-31 13:09:21 +02:00
testImplementation 'junit:junit:4.13'
2020-05-30 19:13:17 +02:00
testImplementation ('org.robolectric:robolectric:3.8') {
2016-04-29 21:09:20 +02:00
exclude group: 'org.bouncycastle', module: 'bcprov-jdk16'
}
2019-11-15 13:37:12 +01:00
testImplementation 'org.mockito:mockito-core:2.18.0'
2016-04-29 21:09:20 +02:00
2020-05-30 19:21:11 +02:00
implementation 'com.jakewharton.timber:timber:4.7.1'
2018-01-20 02:12:43 +01:00
2019-11-15 11:38:30 +01:00
implementation 'org.glassfish:javax.annotation:10.0-b28'
2020-05-30 19:21:11 +02:00
api "com.google.auto.value:auto-value-annotations:1.6.5"
2019-11-15 13:37:12 +01:00
annotationProcessor "com.google.auto.value:auto-value:1.6.2"
implementation 'com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.6'
annotationProcessor "com.ryanharter.auto.value:auto-value-parcel:0.2.6"
2018-01-22 02:04:03 +01:00
2020-05-30 19:21:11 +02:00
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.2.0'
2020-05-30 19:21:11 +02:00
implementation 'androidx.sqlite:sqlite-framework:2.1.0'
2019-11-15 12:09:08 +01:00
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// for debugging the db. don't enable by default, this will expose the database no the network!
// debugImplementation 'com.amitshekhar.android:debug-db:1.0.3'
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
minSdkVersion 15
2021-02-13 21:45:27 +01:00
targetSdkVersion 29
2021-04-30 10:53:15 +02:00
versionCode 57500
versionName "5.7.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
2019-11-15 12:09:08 +01:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2015-06-17 18:30:58 +02:00
// 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 {
2018-01-22 15:39:18 +01:00
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
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-base.pro',
'proguard-rules-bouncycastle.pro',
'proguard-rules-okio.pro',
'proguard-rules-okhttp.pro',
'proguard-rules-support.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 {
2018-01-08 13:19:12 +01:00
// ProGuard disabled for debug builds, instead multidex is enabled!
// faster consecutive build times for developing, https://github.com/open-keychain/open-keychain/pull/2247
minifyEnabled false
//proguardFiles = buildTypes.release.proguardFiles
//testProguardFiles 'proguard-rules-test.pro'
2018-07-09 02:00:00 +02:00
2018-01-08 13:19:12 +01:00
multiDexEnabled true
2017-10-06 02:00:00 +02:00
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 00:31:41 +02:00
}
// Workaround for http://stackoverflow.com/questions/27909613/cannot-see-parameter-value-in-android-studio-when-breakpoint-is-in-first-line-of
debugWithTestCoverage.initWith(debug)
debugWithTestCoverage {
// Enable code coverage (Jacoco)
testCoverageEnabled true
2018-01-20 23:59:41 +01:00
matchingFallbacks = ['debug'] // instead use this
}
2015-05-10 04:58:44 +02:00
}
2018-01-20 23:59:41 +01:00
flavorDimensions("freedom")
2016-02-09 20:48:24 +01:00
productFlavors {
google {
2018-01-20 23:59:41 +01:00
dimension "freedom"
2016-02-09 20:48:24 +01:00
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"
2016-11-07 22:27:27 +01:00
buildConfigField "String", "FLATTR_PROJECT_URL", "null"
buildConfigField "String", "FLATTR_URL", "null"
2016-02-09 20:48:24 +01:00
}
fdroid {
2018-01-20 23:59:41 +01:00
dimension "freedom"
2016-02-09 20:48:24 +01:00
buildConfigField "boolean", "DONATIONS_GOOGLE", "false"
buildConfigField "String", "GOOGLE_PLAY_PUBKEY", "null"
2017-08-28 17:15:03 +02:00
buildConfigField "String", "PAYPAL_USER", "\"android@schuermann.eu\""
2016-02-09 20:48:24 +01:00
buildConfigField "String", "PAYPAL_CURRENCY_CODE", "\"EUR\""
2017-11-16 11:42:07 +01:00
buildConfigField "String", "BITCOIN_ADDRESS", "\"1LY6Hs6SurATjfxnihzLMDUMUuMxvQ4aEi\""
2016-11-07 22:27:27 +01:00
buildConfigField "String", "FLATTR_PROJECT_URL", "\"https://www.openkeychain.org\""
buildConfigField "String", "FLATTR_URL", "\"flattr.com/submit/auto?fid=4vzg0p&url=https%3A%2F%2Fwww.openkeychain.org\""
2016-02-09 20:48:24 +01:00
}
}
variantFilter { variant ->
2020-05-30 19:21:11 +02:00
if(variant.buildType.name == 'debug' && variant.getFlavors().get(0).name == 'google') {
2018-01-22 15:43:31 +01:00
variant.setIgnore(true)
}
}
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 14:37:54 +02:00
release {
2013-09-09 21:11:16 +02:00
storeFile file(signingStoreLocation)
storePassword signingStorePassword
keyAlias signingKeyAlias
keyPassword signingKeyPassword
2013-08-15 14:37:54 +02:00
}
}
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 19:59:15 +01: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 {
2017-02-01 19:32:28 +01:00
preDexLibraries true
// dexInProcess requires much RAM, which is not available on all dev systems
2017-02-01 19:32:28 +01:00
dexInProcess false
jumboMode true
javaMaxHeapSize "2g"
}
2015-04-23 20:36:35 +02:00
2021-03-16 15:29:47 +01:00
buildFeatures {
dataBinding true
2017-02-01 18:53:26 +01:00
}
2015-04-23 20:36:35 +02:00
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-23 20:36:35 +02:00
}
}
2015-06-11 12:54:15 +02:00