seedvault/app/build.gradle

58 lines
1.4 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
targetSdkVersion 26
}
buildTypes {
release {
minifyEnabled false
}
}
lintOptions {
abortOnError false
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs.add('-Xbootclasspath/p:app/libs/android.jar:app/libs/libcore.jar')
}
}
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 {
compileOnly fileTree(include: ['android.jar', 'libcore.jar'], dir: 'libs')
2019-06-03 17:23:09 +02:00
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
}