plugins { id 'com.android.library' } ext { // 是否要编译 uniapp 推送原生插件,默认为 false // Whether to compile uniapp and push native plugins,default is false UNIAPP_MODEL = false } android { compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { minSdkVersion 16 targetSdkVersion 30 versionCode 1 versionName "1.0" //buildConfigField "boolean", "UNIAPP_MODEL", String.valueOf(UNIAPP_MODEL) } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } sourceSets { main { if (!UNIAPP_MODEL) { manifest.srcFile 'src/main/AndroidManifest.xml' java.srcDirs = [ 'src/main/java', 'src/main/native/java' ] } else { manifest.srcFile 'src/main/uniapp/AndroidManifest.xml' java.srcDirs = [ 'src/main/java', 'src/main/uniapp/java' ] } } } } dependencies { implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'com.google.android.material:material:1.4.0' implementation 'com.google.code.gson:gson:2.9.1' // Google FCM implementation "com.tencent.tpns:fcm:1.3.3.3-release" // google cloud implementation('com.google.firebase:firebase-messaging:22.0.0') // xiaomi implementation "com.tencent.tpns:xiaomi:1.3.3.3-release" // meizu implementation "com.tencent.tpns:meizu:1.3.3.3-release" // OPPO implementation "com.tencent.tpns:oppo:1.3.3.3-release" implementation 'commons-codec:commons-codec:1.15' // vivo implementation "com.tencent.tpns:vivo:1.3.3.3-release" // honor implementation 'com.tencent.tpns:honor:1.3.3.3-release' if (!UNIAPP_MODEL) { def projects = this.rootProject.getAllprojects().stream().map { project -> project.name }.collect() println "all TUIOfflinePush projects : {$projects}" if (projects.contains("tuicore")) { api project(':tuicore') } else { api "com.tencent.imsdk:imsdk-plus:7.1.3925" api 'com.tencent.liteav.tuikit:tuicore:1.1.22' } } else { implementation 'com.alibaba:fastjson:1.1.46.android' compileOnly fileTree(dir: 'libs', include: ['uniapp-v8-release.aar']) } }