100 lines
3.1 KiB
Groovy
100 lines
3.1 KiB
Groovy
plugins {
|
|
id 'com.android.application'
|
|
}
|
|
|
|
task conanInstall {
|
|
def conanExecutable = "conan" // define the path to your conan installation
|
|
def buildDir = new File("app/build")
|
|
buildDir.mkdirs()
|
|
["Debug", "Release"].each { String build_type ->
|
|
// ["armv7", "armv8", "x86", "x86_64"]
|
|
["armv8", "x86_64"].each { String arch ->
|
|
def cmd = conanExecutable + " install " +
|
|
"../../.. --profile android -s build_type="+ build_type +" -s arch=" + arch +
|
|
" --build missing -c tools.cmake.cmake_layout:build_folder_vars=['settings.arch']"
|
|
print(">> ${cmd} \n")
|
|
|
|
def sout = new StringBuilder(), serr = new StringBuilder()
|
|
def proc = cmd.execute(null, buildDir)
|
|
proc.consumeProcessOutput(sout, serr)
|
|
proc.waitFor()
|
|
println "$sout $serr"
|
|
if (proc.exitValue() != 0) {
|
|
throw new Exception("out> $sout err> $serr" + "\nCommand: ${cmd}")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "com.erroratline0.infinipaint"
|
|
compileSdk 36
|
|
ndkVersion = "29.0.14206865"
|
|
defaultConfig {
|
|
applicationId 'com.erroratline0.InfiniPaint'
|
|
minSdkVersion 27
|
|
targetSdk 36
|
|
versionCode 1
|
|
versionName "0.5.0"
|
|
externalNativeBuild {
|
|
cmake {
|
|
cppFlags "-fexceptions", "-frtti"
|
|
arguments "-DANDROID_PLATFORM=android-21", "-DANDROID_STL=c++_shared", "-DCMAKE_TOOLCHAIN_FILE=conan_android_toolchain.cmake", "-DGRAPHICS_BACKEND=OpenGLES3.0"
|
|
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
|
abiFilters 'arm64-v8a', 'x86_64'
|
|
}
|
|
}
|
|
}
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
externalNativeBuild {
|
|
cmake {
|
|
cppFlags "-fexceptions", "-frtti"
|
|
arguments "-DCMAKE_BUILD_TYPE=Release"
|
|
}
|
|
}
|
|
signingConfig signingConfigs.debug
|
|
}
|
|
debug {
|
|
minifyEnabled false
|
|
shrinkResources false
|
|
debuggable true
|
|
externalNativeBuild {
|
|
cmake {
|
|
cppFlags "-fexceptions", "-frtti"
|
|
arguments "-DCMAKE_BUILD_TYPE=Debug"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
applicationVariants.all { variant ->
|
|
tasks["merge${variant.name.capitalize()}Assets"]
|
|
.dependsOn("externalNativeBuild${variant.name.capitalize()}")
|
|
}
|
|
|
|
sourceSets.main {
|
|
jniLibs.srcDir 'libs'
|
|
assets.srcDirs = ['../../assets']
|
|
}
|
|
externalNativeBuild {
|
|
cmake {
|
|
version "3.31.6"
|
|
path '../../CMakeLists.txt'
|
|
}
|
|
}
|
|
|
|
lint {
|
|
abortOnError = false
|
|
}
|
|
buildFeatures {
|
|
prefab true
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
implementation "androidx.core:core:1.18.0"
|
|
}
|