flycast/shell/android-studio/reicast/build.gradle

119 lines
3.0 KiB
Groovy

apply plugin: 'com.android.application'
def getBuildId = { ->
def build_id = System.getenv("TRAVIS_JOB_ID") ?: "8"
return Integer.parseInt(build_id)
}
def getVersionHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
def getVersionName = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--always'
standardOutput = stdout
}
return stdout.toString().trim()
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.flycast.emulator"
minSdkVersion 16
targetSdkVersion 28
versionCode getBuildId()
versionName getVersionName()
vectorDrawables.useSupportLibrary = true
externalNativeBuild {
cmake {
arguments '-DANDROID_ARM_MODE=arm'
}
}
ndk {
moduleName 'flycast'
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
signingConfigs {
debug {
storeFile file("../debug.keystore")
}
release {
storeFile file("../reicast-beta-cd.jks")
storePassword "notasecret"
keyAlias "reicast-upload-key"
keyPassword "notasecret"
}
}
buildTypes {
debug {
debuggable true
minifyEnabled true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
release {
debuggable false
minifyEnabled true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
flavorDimensions "systemtype"
productFlavors {
dreamcast {
}
}
externalNativeBuild {
cmake {
version '3.10.2+'
path '../../../CMakeLists.txt'
}
}
lintOptions {
abortOnError false
}
}
afterEvaluate {
android.applicationVariants.all { v ->
if (v.buildType.name == "release") {
def hashtag = getVersionHash()
v.outputs[0].outputFileName = "flycast-android-" + hashtag + ".apk"
}
}
}
dependencies {
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'org.bouncycastle:bcprov-jdk16:1.46'
implementation 'commons-io:commons-io:2.6'
implementation 'org.apache.commons:commons-lang3:3.10'
implementation('com.googlecode.json-simple:json-simple:1.1.1') {
exclude module: 'junit'
}
implementation fileTree(include: ['*.jar'], dir: 'libs')
}