SellyCloudSDK_Android_demo/example/build.gradle

102 lines
3.4 KiB
Groovy

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
def sdkGroupId = rootProject.findProperty("sellySdkGroupId") ?: "com.sellycloud"
def sdkArtifactId = rootProject.findProperty("sellySdkArtifactId") ?: "sellycloudsdk"
def sdkVersion = rootProject.findProperty("sellySdkVersion") ?: "1.0.0"
def hasLocalSdk = rootProject.file("SellyCloudSDK").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 {
def storePath = project.rootProject.file(findProperty("MY_STORE_FILE") ?: "")
if (storePath != null && storePath.exists()) {
storeFile storePath
} else {
storeFile project.rootProject.file(findProperty("MY_STORE_FILE") ?: "release.keystore")
}
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'
signingConfig signingConfigs.release
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
buildFeatures {
viewBinding true
}
}
dependencies {
if (hasLocalSdk) {
implementation project(':SellyCloudSDK')
} else {
implementation files(
"libs/${sdkArtifactId}-${sdkVersion}.aar",
"libs/ijkplayer-cmake-release.aar",
"libs/Kiwi.aar",
"libs/libwebrtc.aar"
)
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.github.pedroSG94.RootEncoder:library:2.6.6'
implementation "com.squareup.okhttp3:okhttp:4.12.0"
}
implementation fileTree(
dir: "libs",
include: ["*.jar", "*.aar"],
exclude: [
"${sdkArtifactId}-${sdkVersion}.aar",
"ijkplayer-cmake-release.aar",
"Kiwi.aar",
"libwebrtc.aar"
]
)
implementation 'androidx.appcompat:appcompat:1.7.0-alpha03'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0-alpha13'
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 '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'
}