100 lines
2.9 KiB
Groovy
100 lines
2.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 keystoreProperties = new Properties()
|
||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||
if (keystorePropertiesFile.exists()) {
|
||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||
}
|
||
|
||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||
if (flutterVersionCode == null) {
|
||
flutterVersionCode = '1'
|
||
}
|
||
|
||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||
if (flutterVersionName == null) {
|
||
flutterVersionName = '1.0'
|
||
}
|
||
|
||
configurations.all {
|
||
resolutionStrategy {
|
||
force 'com.android.billingclient:billing:7.1.1'
|
||
}
|
||
}
|
||
|
||
android {
|
||
namespace "com.petsheroai.app"
|
||
compileSdk 36
|
||
buildFeatures { buildConfig = true }
|
||
ndkVersion flutter.ndkVersion
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_17
|
||
targetCompatibility JavaVersion.VERSION_17
|
||
}
|
||
|
||
kotlinOptions {
|
||
jvmTarget = '17'
|
||
}
|
||
|
||
sourceSets {
|
||
main.java.srcDirs += 'src/main/kotlin'
|
||
}
|
||
|
||
defaultConfig {
|
||
applicationId "com.petsheroai.app"
|
||
minSdkVersion flutter.minSdkVersion
|
||
targetSdk 36
|
||
versionCode flutterVersionCode.toInteger()
|
||
versionName flutterVersionName
|
||
// Facebook SDK 调试:正式包调试时设为 true,上线前改回 false
|
||
buildConfigField "boolean", "FACEBOOK_DEBUG_LOGS", (localProperties.getProperty("facebook.debug") ?: "true")
|
||
}
|
||
|
||
signingConfigs {
|
||
release {
|
||
keyAlias keystoreProperties['keyAlias']
|
||
keyPassword keystoreProperties['keyPassword']
|
||
storeFile file(keystoreProperties['storeFile'])
|
||
storePassword keystoreProperties['storePassword']
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
debug {
|
||
// 允许 HTTP 连接本地代理(手机无法直连域名时)
|
||
manifestPlaceholders = [usesCleartextTraffic: "true"]
|
||
}
|
||
release {
|
||
signingConfig signingConfigs.release
|
||
manifestPlaceholders = [usesCleartextTraffic: "false"]
|
||
}
|
||
}
|
||
}
|
||
|
||
dependencies {
|
||
implementation 'com.facebook.android:facebook-core:18.0.0'
|
||
implementation 'com.google.android.gms:play-services-ads-identifier:18.1.0'
|
||
implementation 'com.android.installreferrer:installreferrer:2.2'
|
||
implementation 'com.adjust.sdk:adjust-android-meta-referrer:5.5.1'
|
||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||
// Play Billing Library 6.0.1+ (use 7.1.1 for in_app_purchase plugin compatibility)
|
||
implementation 'com.android.billingclient:billing:7.1.1'
|
||
}
|
||
|
||
flutter {
|
||
source '../..'
|
||
}
|