123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- apply plugin: 'com.android.application'
- apply plugin: 'kotlin-android'
- apply plugin: 'kotlin-android-extensions'
- apply plugin: 'com.jakewharton.butterknife'
- android {
- compileSdkVersion 29
- buildToolsVersion "29.0.3"
- defaultConfig {
- applicationId "com.cj.autojs.dtok"
- minSdkVersion 21
- targetSdkVersion 29
- versionCode 1
- versionName "1.0"
- buildConfigField "String", "AGENT_USER_ID", "\"1\""
- buildConfigField "String", "PRODUCT_NAME","\"dtok\""
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
- lintOptions {
- abortOnError false
- disable 'MissingTranslation'
- disable 'ExtraTranslation'
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- splits {
- // Configures multiple APKs based on ABI.
- abi {
- // Enables building multiple APKs per ABI.
- enable true
- // By default all ABIs are included, so use reset() and include to specify that we only
- // want APKs for x86 and x86_64.
- // Resets the list of ABIs that Gradle should create APKs for to none.
- reset()
- // Specifies a list of ABIs that Gradle should create APKs for.
- include "x86", "armeabi-v7a","arm64-v8a"
- // Specifies that we do not want to also generate a universal APK that includes all ABIs.
- universalApk false
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- }
- }
- }
- def buildApkPluginForAbi(File pluginProjectDir, String abi) {
- copy {
- from file('..\\app\\release\\')
- into new File(pluginProjectDir, 'app\\src\\main\\assets')
- def fileName = "inrt-" + abi + "-release.apk"
- include fileName
- rename fileName, 'template.apk'
- }
- exec {
- workingDir pluginProjectDir
- commandLine 'gradlew.bat', 'assembleRelease'
- }
- copy {
- from new File(pluginProjectDir, 'app\\build\\outputs\\apk\\release')
- into file('..\\common\\release')
- def fileName = '打包插件-' + versions.appVersionName + '-release.apk'
- include fileName
- rename fileName, '打包插件-' + abi + '-' + versions.appVersionName + '-release.apk'
- }
- }
- task buildApkPlugin {
- doLast {
- def pluginProjectDirPath = '..\\..\\AutoJsApkBuilderPlugin'
- def pluginProjectDir = file(pluginProjectDirPath)
- if (!pluginProjectDir.exists() || !pluginProjectDir.isDirectory()) {
- println 'pluginProjectDir not exists'
- return
- }
- buildApkPluginForAbi(pluginProjectDir, 'armeabi-v7a')
- buildApkPluginForAbi(pluginProjectDir, 'x86')
- buildApkPluginForAbi(pluginProjectDir, 'arm64-v8a')
- }
- }
- tasks.whenTaskAdded { task ->
- if (task.name == 'assembleRelease') {
- task.finalizedBy 'buildApkPlugin'
- }
- }
- repositories {
- flatDir {
- dirs 'libs'
- }
- google()
- }
- dependencies {
- implementation 'com.makeramen:roundedimageview:2.3.0'
- // implementation 'com.github.ZLYang110:MyPermission:1.0'
- implementation fileTree(dir: "libs", include: ["*.jar"])
- //Glide
- implementation('com.github.bumptech.glide:glide:4.2.0', {
- exclude group: 'com.android.support'
- })
- implementation ('com.github.lzyzsd:jsbridge:2.0.0'){
- exclude group: 'com.github.lzyzsd.jsbridge', module: 'jsbridge-debug'
- }
- implementation('com.jakewharton:butterknife:10.2.1', {
- exclude group: 'com.android.support'
- })
- annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
- implementation 'androidx.appcompat:appcompat:1.1.0'
- implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
- implementation 'com.google.android.material:material:1.5.0-alpha02'
- // implementation 'androidx.activity:activity:1.8.0'
- // implementation 'com.google.android.material:material:1.11.0'
- // implementation files('libs/activity-1.7.2.aar')
- implementation "androidx.activity:activity:1.2.4"
- implementation 'com.blankj:utilcodex:1.31.1'
- // implementation 'com.google.android.material:material:1.11.0'
- // implementation 'androidx.activity:activity:1.8.0'
- testImplementation 'junit:junit:4.12'
- androidTestImplementation 'androidx.test.ext:junit:1.1.1'
- androidTestImplementation "android.arch.core:core-testing:1.1.0"
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
- implementation project(':autojs')
- implementation 'com.yanzhenjie:permission:2.0.3'
- }
|