apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
  compileSdkVersion rootProject.ext.compile_sdk_version
  defaultConfig {
    applicationId "com.foolchen.lib.tracker.demo"
    minSdkVersion rootProject.ext.min_sdk_version
    targetSdkVersion rootProject.ext.target_sdk_version
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    // 用于读取本地的配置信息
    Properties properties = new Properties()
    InputStream is = project.rootProject.file('local.properties').newDataInputStream()
    properties.load(is)
    buildConfigField "String", "SERVICE_HOST",
        String.format('\"%1$s\"', properties.getProperty('SERVICE_HOST'))
    buildConfigField "String", "SERVICE_PATH",
        String.format('\"%1$s\"', properties.getProperty('SERVICE_PATH'))
    buildConfigField "String", "PROJECT_NAME",
        String.format('\"%1$s\"', properties.getProperty('PROJECT_NAME'))
  }
  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  implementation project(":tracker")
  //implementation 'com.foolchen.lib:tracker:0.0.3-SNAPSHOT'

  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  implementation "com.android.support:design:$support_library_version"
  implementation "com.android.support:appcompat-v7:$support_library_version"
  implementation "com.android.support:support-fragment:$support_library_version"
  implementation "com.android.support:support-annotations:$support_library_version"
  implementation "com.jakewharton:butterknife:$butter_knife_version"

  implementation "com.android.support.constraint:constraint-layout:$constraint_layout_version"
  testImplementation 'junit:junit:4.12'
  androidTestImplementation 'com.android.support.test:runner:1.0.2'
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  debugImplementation 'com.amitshekhar.android:debug-db:1.0.1'

  implementation 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'

  //Optional: see how to use the utility.
  implementation 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'

  implementation "io.reactivex.rxjava2:rxjava:$rx_java_version"
  implementation("io.reactivex.rxjava2:rxandroid:$rx_android_version") {
    exclude module: 'rxjava'
  }
  implementation("com.jakewharton.rxbinding2:rxbinding:$rx_binding_version") {
    exclude module: 'rxjava'
    exclude module: 'rxandroid'
  }
  implementation("com.jakewharton.rxbinding2:rxbinding-support-v4:$rx_binding_version") {
    exclude module: 'rxjava'
    exclude module: 'rxandroid'
  }
  implementation("com.jakewharton.rxbinding2:rxbinding-appcompat-v7:$rx_binding_version") {
    exclude module: 'rxjava'
    exclude module: 'rxandroid'
  }

  kapt "com.jakewharton:butterknife-compiler:$butter_knife_version"
}

buildscript {
  dependencies {
    classpath "com.jakewharton:butterknife-gradle-plugin:$butter_knife_version"
  }
}
