mirror of
https://github.com/Cateners/tiny_computer.git
synced 2026-05-20 16:35:47 +08:00
139 lines
4.0 KiB
Groovy
139 lines
4.0 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'
|
|
}
|
|
|
|
def keystoreProperties = new Properties()
|
|
def keystorePropertiesFile = rootProject.file('keystore.properties')
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
android {
|
|
namespace "com.example.tiny_computer"
|
|
compileSdkVersion flutter.compileSdkVersion
|
|
ndkVersion "27.0.12077973" // flutter.ndkVersion
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = 17
|
|
}
|
|
|
|
sourceSets {
|
|
main.java.srcDirs += 'src/main/kotlin'
|
|
main.java.srcDirs += 'src/main/java'
|
|
}
|
|
|
|
defaultConfig {
|
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
applicationId "com.fct.tiny"
|
|
// You can update the following values to match your application needs.
|
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
|
minSdk 28 // glob() version //proot version //ffmpeg_kit; flutter.minSdkVersion
|
|
targetSdk 28 //https://github.com/termux/termux-app/issues/1072; native; linker; flutter.targetSdkVersion
|
|
versionCode flutterVersionCode.toInteger()
|
|
versionName flutterVersionName
|
|
|
|
buildConfigField "String", "COMMIT", "\"" + ("git rev-parse HEAD\n".execute().getText().trim() ?: (System.getenv('CURRENT_COMMIT') ?: "NO_COMMIT")) + "\""
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
cppFlags "-std=c++11"
|
|
arguments "-DANDROID_STL=c++_shared"
|
|
}
|
|
}
|
|
|
|
ndk {
|
|
abiFilters 'arm64-v8a'
|
|
}
|
|
|
|
}
|
|
signingConfigs {
|
|
release {
|
|
keyAlias keystoreProperties['keyAlias']
|
|
keyPassword keystoreProperties['keyPassword']
|
|
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
|
storePassword keystoreProperties['storePassword']
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
signingConfig signingConfigs.release
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
debug {
|
|
signingConfig signingConfigs.debug
|
|
minifyEnabled true
|
|
shrinkResources false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
aidl true
|
|
dataBinding true
|
|
viewBinding true
|
|
buildConfig true
|
|
}
|
|
|
|
|
|
lint {
|
|
disable "NullSafeMutableLiveData"
|
|
}
|
|
|
|
lintOptions {
|
|
//checkReleaseBuilds false
|
|
abortOnError false
|
|
}
|
|
externalNativeBuild {
|
|
cmake {
|
|
path "src/main/cpp/CMakeLists.txt"
|
|
version "3.22.1"
|
|
}
|
|
}
|
|
|
|
packagingOptions {
|
|
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
|
pickFirst 'lib/x86_64/libc++_shared.so'
|
|
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
|
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source '../..'
|
|
}
|
|
|
|
dependencies {
|
|
implementation "androidx.core:core-ktx:1.15.0"
|
|
implementation "androidx.appcompat:appcompat:1.7.0"
|
|
implementation "com.google.android.material:material:1.7.0"
|
|
implementation 'com.github.tiann:FreeReflection:3.2.2'
|
|
}
|