infinipaint/android-project/app/build.gradle

101 lines
3.1 KiB
Groovy
Raw Normal View History

2026-02-24 17:21:41 +03:00
plugins {
2026-03-23 10:04:32 +03:00
id 'com.android.application'
2026-02-24 17:21:41 +03:00
}
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"
2026-05-17 13:21:29 +03:00
compileSdk 36
2026-02-24 17:21:41 +03:00
ndkVersion = "29.0.14206865"
defaultConfig {
applicationId 'com.erroratline0.InfiniPaint'
2026-05-17 11:27:20 +03:00
minSdkVersion 27
2026-05-17 13:21:29 +03:00
targetSdk 36
versionCode 2
versionName "0.6.0"
2026-02-24 17:21:41 +03:00
externalNativeBuild {
cmake {
2026-05-16 18:59:21 +03:00
cppFlags "-fexceptions", "-frtti"
2026-03-23 10:04:32 +03:00
arguments "-DANDROID_PLATFORM=android-21", "-DANDROID_STL=c++_shared", "-DCMAKE_TOOLCHAIN_FILE=conan_android_toolchain.cmake", "-DGRAPHICS_BACKEND=OpenGLES3.0"
2026-02-24 17:21:41 +03:00
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
abiFilters 'arm64-v8a', 'x86_64'
}
}
}
buildTypes {
release {
2026-02-26 20:58:56 +03:00
minifyEnabled true
shrinkResources true
2026-05-17 13:21:29 +03:00
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2026-02-26 20:58:56 +03:00
externalNativeBuild {
cmake {
2026-05-16 18:59:21 +03:00
cppFlags "-fexceptions", "-frtti"
2026-02-26 20:58:56 +03:00
arguments "-DCMAKE_BUILD_TYPE=Release"
}
}
signingConfig signingConfigs.debug
}
debug {
minifyEnabled false
shrinkResources false
debuggable true
externalNativeBuild {
cmake {
2026-05-16 18:59:21 +03:00
cppFlags "-fexceptions", "-frtti"
2026-02-26 20:58:56 +03:00
arguments "-DCMAKE_BUILD_TYPE=Debug"
}
}
2026-02-24 17:21:41 +03:00
}
}
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')
2026-05-31 18:35:57 +03:00
implementation "androidx.core:core:1.18.0"
2026-02-24 17:21:41 +03:00
}