apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: '../localconfig.gradle'

android {
    compileSdkVersion 30
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.xj.anchortask"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
    }

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

Properties properties = loadProperties("local.properties")
String mode = null
if (properties != null) {
    mode = getValue(properties, "mode", "local")
}
println("mode is $mode")
print("anchorTaskVersion is ${anchorTaskVersion}")

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.3.2'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    implementation 'com.google.android:flexbox:2.0.1'


    implementation "androidx.startup:startup-runtime:1.0.0"
    implementation 'androidx.work:work-runtime:2.3.4'
    implementation 'com.google.android.material:material:1.4.0'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    if (mode == "local") {
        implementation "com.xj.android:anchortask:${anchorTaskVersion}-local"
    } else if (mode == "remote") {
        implementation "com.xj.android:anchortask:${anchorTaskVersion}"
    } else {
        implementation project(path: ':anchortasklibrary')
    }


}