seedvault/app/build.gradle

87 lines
2.6 KiB
Groovy
Raw Normal View History

import groovy.xml.XmlUtil
apply plugin: 'com.android.application'
android {
2019-06-03 17:23:09 +02:00
2019-02-12 04:00:33 +01:00
compileSdkVersion 28
2019-06-03 17:23:09 +02:00
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 26
2019-06-11 15:25:36 +02:00
targetSdkVersion 28
2019-06-03 17:23:09 +02:00
}
buildTypes {
release {
minifyEnabled false
}
}
lintOptions {
abortOnError false
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
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
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
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"
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()
}
}
dependencies {
2019-06-12 17:40:43 +02:00
// To produce these binaries, in latest AOSP source tree, run
// $ make
compileOnly 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')
2019-06-03 17:23:09 +02:00
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
2019-06-07 19:09:55 +02:00
// androidx uses old versions, but we need to use what AOSP currently supports
implementation 'androidx.preference:preference:1.0.0-alpha1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0-alpha1'
}