droidfish/DroidFishApp/build.gradle

81 lines
2.3 KiB
Groovy
Raw Normal View History

2019-03-17 09:11:36 +01:00
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "org.petero.droidfish"
minSdkVersion 16
targetSdkVersion 28
2019-04-17 19:46:35 +02:00
versionCode 83
versionName "1.74"
2019-03-17 09:11:36 +01:00
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
ndkBuild {
arguments '-j8'
}
}
}
if(project.hasProperty("RELEASE_STORE_FILE")) {
signingConfigs {
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
if(project.hasProperty("RELEASE_STORE_FILE")) {
signingConfig signingConfigs.release
}
}
}
externalNativeBuild {
ndkBuild {
path file('src/main/cpp/Android.mk')
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(':CuckooChessEngine')
implementation 'com.caverock:androidsvg-aar:1.3'
2019-03-17 09:11:36 +01:00
}
// Build the ECO database
task buildEco {
def a = "buildSrc/src/main/java/chess/eco.pgn"
2019-03-17 09:11:36 +01:00
def b = "DroidFishApp/src/main/assets/eco.dat"
chess.EcoBuilder.main2(a, b)
2019-03-17 09:11:36 +01:00
}
preBuild.dependsOn buildEco
// Copy Stockfish executables to assets directory
task copyToAssets(type: Copy, dependsOn: 'externalNativeBuildRelease') {
from('build/intermediates/ndkBuild/release/obj/local') {
include '*/stockfish'
}
into 'src/main/assets'
}
tasks.withType(JavaCompile) {
t -> t.dependsOn copyToAssets
}