build.gradle 2.09 KB
Newer Older
徐健 committed
1 2 3 4
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
徐健 committed
5

徐健 committed
6 7 8 9 10 11 12
kapt {
    arguments {
        arg("AROUTER_MODULE_NAME", project.getName())
    }
}

android {
徐健 committed
13 14
    compileSdkVersion rootProject.ext.android["compileSdkVersion"]
    buildToolsVersion rootProject.ext.android["buildToolsVersion"]
徐健 committed
15 16

    defaultConfig {
徐健 committed
17 18 19 20
        minSdkVersion rootProject.ext.android["minSdkVersion"]
        targetSdkVersion rootProject.ext.android["targetSdkVersion"]
        versionCode 1
        versionName "1.0"
徐健 committed
21

徐健 committed
22
        multiDexEnabled true
YKai committed
23
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
徐健 committed
24 25
        flavorDimensions "versionCode"

徐健 committed
26 27 28 29
    }

    lintOptions {
        abortOnError false
徐健 committed
30 31 32 33 34 35 36 37 38
    }

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

徐健 committed
39 40 41 42 43 44 45
    //Flavor 信息
    publishNonDefault true
    productFlavors {
        ydl {}
        xlzx {}
    }

徐健 committed
46 47 48 49 50 51 52 53 54 55
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

}

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])

YKai committed
56 57 58 59
    implementation 'androidx.appcompat:appcompat:1.2.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
徐健 committed
60

徐健 committed
61 62 63 64
    implementation "com.alibaba:arouter-api:$arouter_api"
//    注意此处的依赖方式:kotlin中使用和java中使用方式有不同
    kapt "com.alibaba:arouter-compiler:$arouter_compiler"

徐健 committed
65 66 67
    if (rootProject.ext.dev_mode){
        //开发时使用
        api project(":ydl-platform")
徐健 committed
68
        implementation project(':ydl-media')
69
        implementation project(':ydl-flutter-base')
徐健 committed
70 71
    } else {
        //发布时使用
徐健 committed
72
        api rootProject.ext.dependencies["ydl-media"]
73

徐健 committed
74 75 76
        api (rootProject.ext.dependencies["ydl-platform"]) {
            transitive = true
        }
徐健 committed
77 78

        implementation rootProject.ext.dependencies["ydl-flutter-base"]
徐健 committed
79 80
    }
}