apply plugin: 'com.android.application' if (sample) { apply plugin: 'com.iqiyi.qigsaw.sample.application' } else { apply plugin: 'com.iqiyi.qigsaw.application' } android { compileSdkVersion versions.compileSdk defaultConfig { applicationId "com.iqiyi.qigsaw.sample" minSdkVersion versions.minSdk targetSdkVersion versions.targetSdk multiDexEnabled true multiDexKeepProguard file('multidexkeep.pro') versionCode 271 versionName "1.0.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ndk { abiFilters 'arm64-v8a', 'x86'//for emulator } } signingConfigs { debug { storeFile new File(project.rootProject.projectDir.absolutePath + "/keystore/debug.jks") storePassword "qigsawtest" keyAlias "qigsawtest" keyPassword "qigsawtest" } release { storeFile new File(project.rootProject.projectDir.absolutePath + "/keystore/release.jks") storePassword "qigsawtest" keyAlias "qigsawtest" keyPassword "qigsawtest" } } buildTypes { release { minifyEnabled true zipAlignEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } debug { minifyEnabled false signingConfig signingConfigs.debug } } compileOptions { sourceCompatibility = '1.8' targetCompatibility = '1.8' } dynamicFeatures = [':java', ':assets', ':native'] } def qigsawPath = file("qigsaw/") qigsawSplit { /** * Whether repack base apk with 7z format. * default value is {@code false} */ use7z = false /** * optional,default 'null' * if you want to update split version, oldApk must be set. */ oldApk = "${qigsawPath}/app.apk" /** * optional,default 'null' * if you want to update splits, applyMapping must be set. */ applyMapping = "${qigsawPath}/mapping.txt" /** * optional, default 'false' * Whether upload all split APKs to CDN, ignored 'onDemand' declared in split AndroidManifest file. */ releaseSplitApk = false /** * Whether build multiple APKs for ABIs */ multipleApkForABIs = true /** * optional, default '1.0.0' * when update splits, you need upgrade value of splitInfoVersion */ splitInfoVersion = '1.0.0' /** * optional, default 'null' * * restrict split only work in processes which declared in split AndroidManifest file. */ restrictWorkProcessesForSplits = ['java'] /** * Split fragments which would be loaded by activities of base apk.(Not all fragments in split apk) */ splitEntryFragments = ['com.iqiyi.qigsaw.sample.java.JavaSampleFragment'] /** * Activities of base apk which would load split's fragments or resources. */ baseContainerActivities = ["com.iqiyi.qigsaw.sample.MainActivity"] } if (sample) { splitUpload { /** * Whether upload all split apks to test env */ useTestEnv = true /** * You can decide which split apks should be upload to test env. */ testOnly = ["java"] } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) api 'androidx.appcompat:appcompat:1.0.0' implementation 'androidx.multidex:multidex:2.0.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' if (sample) { api "com.iqiyi.android.qigsaw:splitcore:${VERSION_NAME}" } else { api project(':splitcore') } implementation project(':downloader') testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' }