build.gradle 3.94 KB
Newer Older
konghaorui committed
1 2 3 4
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
konghaorui committed
5
apply plugin: 'resTools' // 资源重命名插件
konghaorui committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19

// 配置资源重命名插件
resConfig {
    new_prefix = 'im_'  // 资源前缀
    old_prefix = ''         // 老前缀,可为''空字符串
}

kapt {
    arguments {
        arg("AROUTER_MODULE_NAME", "im")
    }
}

android {
konghaorui committed
20 21 22
    compileSdkVersion rootProject.ext.android["compileSdkVersion"]
    buildToolsVersion rootProject.ext.android["buildToolsVersion"]

konghaorui committed
23 24

    defaultConfig {
konghaorui committed
25 26
        minSdkVersion rootProject.ext.android["minSdkVersion"]
        targetSdkVersion rootProject.ext.android["targetSdkVersion"]
konghaorui committed
27 28 29
        versionCode 1
        versionName "1.0"

YKai committed
30
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
konghaorui committed
31 32 33 34 35 36 37 38 39

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [AROUTER_MODULE_NAME: "im"]
            }
        }

        flavorDimensions "versionCode"//Flavor 维度信息

konghaorui committed
40
        ndk {
霍志良 committed
41
            abiFilters  "arm64-v8a"
konghaorui committed
42
        }
konghaorui committed
43 44 45 46 47 48 49 50 51 52
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    //前缀的名字
konghaorui committed
53
    //resourcePrefix "im_"
konghaorui committed
54 55 56 57 58 59 60 61 62 63 64 65

    //Flavor 信息
    publishNonDefault true
    productFlavors {
        ydl {}
        xlzx {}
    }

    sourceSets {
        main {
            manifest.srcFile 'src/main/AndroidManifest.xml'
            res.srcDirs = [
konghaorui committed
66 67 68
                    'src/main/res',
                    'src/main/res_avchat',
                    'src/main/res_uikit'
konghaorui committed
69 70 71 72 73 74 75 76 77 78 79 80
            ]
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    api fileTree(dir: 'libs', include: ['*.aar','*.jar'])
YKai committed
81
    implementation 'androidx.appcompat:appcompat:1.0.0'
konghaorui committed
82
    testImplementation 'junit:junit:4.12'
YKai committed
83 84
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
konghaorui committed
85
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
konghaorui committed
86
    kapt 'com.alibaba:arouter-compiler:1.2.2'
87
    implementation 'com.ydl:nim-base:1.1.0.4'
霍志良 committed
88
//    implementation 'com.netease.nimlib:basesdk:8.5.0'
89 90
    implementation 'com.netease.nimlib:avchat:9.1.1'
    implementation 'com.netease.nimlib:nrtc:9.1.1'
konghaorui committed
91
    api rootProject.ext.dependencies["ydl-user-router"]
刘鹏 committed
92 93
    implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]

konghaorui committed
94 95 96 97
    if (rootProject.ext.dev_mode){
        //开发时使用
        api project(':ydl-webview')
        api project(':ydl-platform')
konghaorui committed
98
        implementation modularPublication('com.ydl:m-im-api')
konghaorui committed
99
        implementation modularPublication('com.ydl:m-user-api')
100 101
        implementation modularPublication('com.ydl:m-dynamic-api')
        implementation modularPublication('com.ydl:m-tests-api')
konghaorui committed
102 103 104 105
        implementation modularPublication('com.ydl:m-course-api')
        implementation modularPublication('com.ydl:m-fm-api')
        implementation modularPublication('com.ydl:m-consultant-api')
        implementation modularPublication('com.ydl:m-confide-api')
konghaorui committed
106 107
    }else {
        //发布时使用
konghaorui committed
108
        compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
konghaorui committed
109 110 111 112 113 114 115
        compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-course-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
konghaorui committed
116 117 118 119 120 121
        api rootProject.ext.dependencies["ydl-webview"]
        api(rootProject.ext.dependencies["ydl-platform"]) {
            transitive = true
        }
    }
}