Files
SellyCloudSDK_Android_demo/example/build.gradle

94 lines
3.2 KiB
Groovy

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
def sdkAarPath = "libs/${findProperty("sellySdkArtifactId") ?: "sellycloudsdk"}-${findProperty("sellySdkVersion") ?: "1.0.0"}.aar"
def releaseStorePath = project.rootProject.file(findProperty("MY_STORE_FILE") ?: "release.keystore")
def hasReleaseKeystore = releaseStorePath.exists()
android {
namespace 'com.demo.SellyCloudSDK'
compileSdk 34
defaultConfig {
ndk {
abiFilters "armeabi-v7a", "arm64-v8a" // 同时打包 32/64 位
}
resConfigs "zh", "en" // 仅保留中文和英文资源
applicationId "com.demo.SellyCloudSDK"
minSdk 26
targetSdk 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
if (hasReleaseKeystore) {
storeFile releaseStorePath
storePassword findProperty("MY_STORE_PASSWORD") ?: ""
keyAlias findProperty("MY_KEY_ALIAS") ?: ""
keyPassword findProperty("MY_KEY_PASSWORD") ?: ""
v1SigningEnabled true
v2SigningEnabled true
}
}
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
if (hasReleaseKeystore) {
signingConfig signingConfigs.release
} else {
// Allow local CI/dev builds without a private keystore.
signingConfig signingConfigs.debug
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation files(
sdkAarPath,
"libs/fu_core_all_feature_release.aar",
"libs/fu_model_all_feature_release.aar"
)
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.7.0-alpha03'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation 'androidx.core:core-ktx:1.13.1'
// implementation "com.squareup.okhttp3:okhttp:4.12.0"
implementation 'androidx.constraintlayout:constraintlayout:2.2.0-alpha13'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.activity:activity-ktx:1.9.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.4'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation "io.coil-kt:coil:2.6.0"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:core:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test:runner:1.5.2'
}