flet-build-template/{{cookiecutter.out_dir}}/android/app/build.gradle

78 lines
1.9 KiB
Groovy

plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
namespace "{{ cookiecutter.org_name }}.{{ cookiecutter.project_name }}"
compileSdkVersion flutter.compileSdkVersion
ndkVersion "25.1.8937393"
packagingOptions {
jniLibs {
useLegacyPackaging true
}
doNotStrip "*/arm64-v8a/libpython*.so"
doNotStrip "*/armeabi-v7a/libpython*.so"
doNotStrip "*/x86/libpython*.so"
doNotStrip "*/x86_64/libpython*.so"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "{{ cookiecutter.org_name }}.{{ cookiecutter.project_name }}"
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// {% if not cookiecutter.split_per_abi1 %}
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
}
// {% endif %}
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {}