build.gradle 3.52 KB
Newer Older
1
apply plugin: 'com.android.library'
2 3 4
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
konghaorui committed
5
apply plugin: 'resTools' // 资源重命名插件
6 7 8 9 10 11

// 配置资源重命名插件
resConfig {
    new_prefix = 'user_'  // 资源前缀
    old_prefix = ''         // 老前缀,可为''空字符串
}
12 13 14 15 16 17

kapt {
    arguments {
        arg("AROUTER_MODULE_NAME", "user")
    }
}
konghaorui committed
18 19

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

        javaCompileOptions {
            annotationProcessorOptions {
34
                arguments = [AROUTER_MODULE_NAME: "user"]
konghaorui committed
35 36
            }
        }
konghaorui committed
37

konghaorui committed
38
        flavorDimensions "versionCode"//Flavor 维度信息
konghaorui committed
39 40 41 42 43 44 45 46 47

    }

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

    //前缀的名字
50
    resourcePrefix "user_"
51 52

    //Flavor 信息
konghaorui committed
53 54 55 56 57
    publishNonDefault true
    productFlavors {
        ydl {}
        xlzx {}
    }
konghaorui committed
58

konghaorui committed
59 60
    sourceSets {
        main {
61 62 63 64
            manifest.srcFile 'src/main/AndroidManifest.xml'
            res.srcDirs = [
                    'src/main/res'
            ]
konghaorui committed
65 66
        }
    }
67

YKai committed
68

69 70 71 72
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
konghaorui committed
73 74 75
}

dependencies {
76
    api fileTree(dir: 'libs', include: ['*.aar','*.jar'])
YKai committed
77 78 79 80 81
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.annotation:annotation:1.1.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
82
    kapt 'com.alibaba:arouter-compiler:1.2.2'
konghaorui committed
83
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
84

konghaorui committed
85 86 87 88 89
    api rootProject.ext.dependencies["ydl-user-router"]
    if (rootProject.ext.dev_mode){
        //开发时使用
        api project(':ydl-webview')
        api project(':ydl-platform')
ydl committed
90
        api project(":ydl-pay")
91
//        implementation project(":ydl-tuicore")
konghaorui committed
92
        implementation modularPublication('com.ydl:m-user-api')
ydl committed
93
        implementation modularPublication('com.ydl:m-course-api')
konghaorui committed
94 95
        implementation modularPublication('com.ydl:m-im-api')
        implementation modularPublication('com.ydl:m-fm-api')
ydl committed
96
        implementation modularPublication('com.ydl:m-dynamic-api')
严久程 committed
97
        implementation modularPublication('com.ydl:m-consultant-api')
konghaorui committed
98 99 100
    }else {
        //发布时使用
        compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
ydl committed
101
        compileOnly rootProject.ext.dependencies['ydl-m-course-api']
konghaorui committed
102 103
        compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
ydl committed
104
        compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
严久程 committed
105
        compileOnly rootProject.ext.dependencies['ydl-m-consultant-api']
konghaorui committed
106
        api rootProject.ext.dependencies["ydl-webview"]
ydl committed
107
        api rootProject.ext.dependencies["ydl-pay"]
konghaorui committed
108 109 110
        api(rootProject.ext.dependencies["ydl-platform"]) {
            transitive = true
        }
111
//        implementation rootProject.ext.dependencies["ydl-tuicore"]
konghaorui committed
112
    }
konghaorui committed
113
}