import java.text.DateFormat
import java.text.SimpleDateFormat

plugins {
    id 'com.android.application'
}

def currentTime = getCurrentTime()

static def getCurrentTime() {
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd")
    return df.format(Calendar.getInstance(Locale.CHINA).getTime())
}


android {

    compileSdk 33

    defaultConfig {
        applicationId "com.bg7yoz.ft8cn"
        minSdk 23
        targetSdk 33
        versionCode 1
        versionName '0.89'

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        dataBinding{
            enabled true
        }

        externalNativeBuild {
            cmake {
                cppFlags '-JENABLE_XOM=false'//关闭XOM，

            }
        }
        signingConfig signingConfigs.debug
    }

    buildTypes {

        debug{
            buildConfigField("String", "apkBuildTime", "\"${currentTime}\"")
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            buildConfigField("String", "apkBuildTime", "\"${currentTime}\"")

            // true - 打开混淆
            //minifyEnabled true
            // true - 打开资源压缩
            //shrinkResources true

        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
//    externalNativeBuild {
//        cmake {
//            path file('src/main/cpp/CMakeLists.txt')
//            version '3.18.1'
//        }
//    }
    namespace 'com.bg7yoz.ft8cn'
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.navigation:navigation-fragment:2.4.1'
    implementation 'androidx.navigation:navigation-ui:2.4.1'
    implementation 'com.google.android.gms:play-services-maps:18.0.2'

//    implementation 'com.google.code.gson:gson:2.7'
    implementation 'commons-net:commons-net:3.6'//用于时间同步
    implementation 'com.google.guava:guava:31.1-jre'//用于HashTable（多key的HashMap）

    //testImplementation 'junit:junit:4.13.2'
    //androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    //androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    implementation files('src/libs/MPAndroidChartv_3.1.0.jar')
    implementation files('src/libs/nanohttpd-2.2.0.jar')
    implementation files('src/libs/osmdroid-android-6.1.14.aar')//地图控件
}