build.gradle 4.51 KB
plugins {
    id 'com.android.application'
    id 'io.objectbox'
}

android {
    compileSdkVersion 29
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.whaty.nafmii"
        minSdkVersion 24
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        buildConfigField "String", "API_HOST", "\"http://10.10.81.189/nafmii/app/\""
        buildConfigField "String", "IMG_API", "\"http://10.10.81.172/group1/\""
        buildConfigField "String", "WX_APPID", "\"1234567890\""
        buildConfigField "boolean", "SHOW_INPUT", "true"
        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [
                        "objectbox.modelPath"         : "$projectDir\\schemas\\objectbox.json".toString(),
                        "objectbox.myObjectBoxPackage": "com.polysoft.nafmii.database"
                ]
            }
        }
        manifestPlaceholders = [
                JPUSH_PKGNAME : applicationId,
                JPUSH_APPKEY  : "ef86f246857d981193987dee",//值来自开发者平台取得的AppKey
                JPUSH_CHANNEL : "default_developer",

                //meizu_config_start
//                MEIZU_APPKEY  : "MZ-魅族的APPKEY",
//                MEIZU_APPID   : "MZ-魅族的APPID",
                //meizu_config_end
                //xiaomi_config_start
                XIAOMI_APPID  : "MI-小米的APPID",
                XIAOMI_APPKEY : "MI-小米的APPKEY",
                //xiaomi_config_end
                //oppo_config_start
//                OPPO_APPKEY   : "OP-oppo的APPKEY",
//                OPPO_APPID    : "OP-oppo的APPID",
//                OPPO_APPSECRET: "OP-oppo的APPSECRET",
//                //oppo_config_end
//                //vivo_config_start
//                VIVO_APPKEY   : "vivo的APPKEY",
//                VIVO_APPID    : "vivo的APPID",
                //vivo_config_end


        ]
    }

    buildTypes {
        release {
            minifyEnabled true                      //是否混淆
            zipAlignEnabled true                    //是否设置zip对齐优化
            shrinkResources true                    // 移除无用的resource文件
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            buildConfigField "boolean", "SHOW_INPUT", "false"
        }
        pro { // 预生产
            resValue "string", "app_name", "Nafmii-pro"
        }

        beta { // 测试
            resValue "string", "app_name", "Nafmii-beta"
            applicationIdSuffix "beta"
        }
        debug {
            minifyEnabled false
            resValue "string", "app_name", "Nafmii-dev"
            applicationIdSuffix "dev"
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    signingConfigs {
        debug {
            storeFile file('D:\\studio-workspace\\nafmii\\nafmii.keystore')
            storePassword 'whaty123'
            keyPassword 'whaty123'
            keyAlias 'whaty'
        }
    }
    ndkVersion '20.0.5594570'
}

dependencies {
    implementation 'androidx.wear:wear:1.0.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    implementation 'ren.yale.android:cachewebviewlib:2.1.8'
    implementation 'com.alibaba:fastjson:1.2.75'
    implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.7.0'
    implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.2'
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    implementation 'org.greenrobot:eventbus:3.2.0'
    implementation 'cn.jiguang.sdk:jpush:4.3.0'  // 此处以JPush 4.3.0 版本为例。
    implementation 'cn.jiguang.sdk:jcore:2.9.0'  // 此处以JCore 2.9.0 版本为例。
    implementation "io.objectbox:objectbox-android:$objectboxVersion"
    annotationProcessor "io.objectbox:objectbox-processor:$objectboxVersion"
    implementation 'me.jessyan:autosize:1.2.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    compileOnly 'com.google.android.wearable:wearable:2.7.0'
}