seedvault/app/build.gradle

146 lines
5 KiB
Groovy
Raw Normal View History

import groovy.xml.XmlUtil
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
2019-06-03 17:23:09 +02:00
compileSdkVersion 29
buildToolsVersion '29.0.2' // adapt in .travis.yaml if changed here
2019-06-03 17:23:09 +02:00
defaultConfig {
minSdkVersion 29
targetSdkVersion 29
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments disableAnalytics: 'true'
2019-06-03 17:23:09 +02:00
}
buildTypes {
release {
minifyEnabled false
}
}
lintOptions {
abortOnError false
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
testOptions {
unitTests.all {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
unitTests {
includeAndroidResources = true
}
}
2019-06-03 20:51:58 +02:00
sourceSets {
test {
java.srcDirs += "$projectDir/src/sharedTest/java"
}
androidTest {
java.srcDirs += "$projectDir/src/sharedTest/java"
}
}
2019-06-03 20:51:58 +02:00
// optional signingConfigs
def keystorePropertiesFile = rootProject.file("keystore.properties")
if (keystorePropertiesFile.exists()) {
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes.release.signingConfig = signingConfigs.release
buildTypes.debug.signingConfig = signingConfigs.release
2019-06-03 20:51:58 +02:00
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
options.compilerArgs.addAll(['--release', '8'])
}
options.compilerArgs.add('-Xbootclasspath/p:app/libs/android.jar:app/libs/libcore.jar')
}
}
2019-06-11 15:25:36 +02:00
// http://www.31mins.com/android-studio-build-system-application/
2019-06-03 17:23:09 +02:00
preBuild.doLast {
def imlFile = file(project.name + ".iml")
2019-06-03 17:23:09 +02:00
try {
def parsedXml = (new XmlParser()).parse(imlFile)
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
parsedXml.component[1].remove(jdkNode)
2019-06-03 17:23:09 +02:00
def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform"
//noinspection GroovyResultOfObjectAllocationIgnored // the note gets inserted
2019-06-03 17:23:09 +02:00
new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
2019-06-03 17:23:09 +02:00
} catch (NullPointerException | FileNotFoundException ex) {
ex.printStackTrace()
}
}
// To produce these binaries, in latest AOSP source tree, run
// $ make
def aospDeps = fileTree(include: [
// out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar
'android.jar',
// out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar
'libcore.jar'
], dir: 'libs')
dependencies {
compileOnly aospDeps
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
2019-07-03 12:44:12 +02:00
implementation 'commons-io:commons-io:2.6'
implementation 'io.github.novacrypto:BIP39:2019.01.27'
2019-12-16 17:11:11 +01:00
implementation 'org.koin:koin-androidx-viewmodel:2.0.1'
2019-06-07 19:09:55 +02:00
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.preference:preference-ktx:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0-rc03'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
lintChecks 'com.github.thirdegg:lint-rules:0.0.4-alpha'
def junit_version = "5.5.2" // careful, upgrading this can change a Cipher's IV size in tests!?
2020-08-06 17:33:36 +02:00
def mockk_version = "1.10.0"
testImplementation aospDeps // anything less fails tests run with gradlew
testImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
2020-08-06 17:33:36 +02:00
testImplementation "io.mockk:mockk:$mockk_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:$junit_version"
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
2020-08-06 17:33:36 +02:00
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation "io.mockk:mockk-android:$mockk_version"
}