2019-03-17 09:11:36 +01:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion 28
|
2021-06-06 02:26:55 +02:00
|
|
|
|
2019-03-17 09:11:36 +01:00
|
|
|
defaultConfig {
|
|
|
|
applicationId "org.petero.droidfish"
|
|
|
|
minSdkVersion 16
|
|
|
|
targetSdkVersion 28
|
2021-07-02 21:02:01 +02:00
|
|
|
versionCode 96
|
|
|
|
versionName "1.86"
|
2019-04-20 12:02:44 +02:00
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
2019-03-17 09:11:36 +01:00
|
|
|
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
|
|
|
|
}
|
2019-04-21 23:35:56 +02:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility = '1.8'
|
|
|
|
targetCompatibility = '1.8'
|
|
|
|
}
|
2019-04-22 21:34:16 +02:00
|
|
|
|
2021-06-06 02:26:55 +02:00
|
|
|
buildFeatures {
|
|
|
|
dataBinding true
|
|
|
|
}
|
2019-03-17 09:11:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
2020-03-26 23:26:39 +01:00
|
|
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
2019-04-20 12:02:44 +02:00
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
2020-03-26 23:26:39 +01:00
|
|
|
implementation 'com.google.android.material:material:1.1.0'
|
|
|
|
testImplementation 'junit:junit:4.13'
|
|
|
|
androidTestImplementation 'androidx.test:runner:1.2.0'
|
|
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
2019-03-17 09:11:36 +01:00
|
|
|
implementation project(':CuckooChessEngine')
|
2020-03-26 23:26:39 +01:00
|
|
|
implementation 'com.caverock:androidsvg-aar:1.4'
|
2019-03-17 09:11:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Build the ECO database
|
|
|
|
task buildEco {
|
2019-03-24 21:23:23 +01:00
|
|
|
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"
|
2019-03-24 21:23:23 +01:00
|
|
|
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'
|
2020-09-13 15:51:12 +02:00
|
|
|
include '*/stockfish_nosimd'
|
2019-03-17 09:11:36 +01:00
|
|
|
}
|
|
|
|
into 'src/main/assets'
|
|
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
t -> t.dependsOn copyToAssets
|
|
|
|
}
|
2021-06-06 02:26:55 +02:00
|
|
|
android {
|
|
|
|
applicationVariants.all { variant ->
|
|
|
|
tasks["merge${variant.name.capitalize()}Assets"]
|
|
|
|
.dependsOn(copyToAssets)
|
|
|
|
}
|
|
|
|
}
|