apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
  compileSdkVersion 29
  buildToolsVersion "29.0.2"
  defaultConfig {
    applicationId "com.avatarfirst.avatagen"
    minSdkVersion 15
    targetSdkVersion 29
    versionCode 4
    versionName "1.4"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  }
  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}


ext{
 dUser = "dummy"
 dKey = "dummy"
}

task createFile {
  Properties properties = new Properties()
  def propertyFile = project.rootProject.file('local.properties')
  if (!propertyFile.exists()) {
    print("property file does not exist will create")
    propertyFile.createNewFile()
  }

  if (project.hasProperty("user")) {
    dUser = user
    dKey = key

  }else{
    print ("use dummy")
  }
  print(dUser+":"+dKey)
  properties.load(project.rootProject.file('local.properties').newDataInputStream())

  properties.setProperty("bintray.user",dUser)
  properties.setProperty("bintray.apikey",dKey)
  propertyFile.withWriter { properties.store(it, null) }
}
dependencies {
  implementation fileTree(include: ['*.jar'], dir: 'libs')
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  implementation 'androidx.appcompat:appcompat:1.1.0'
  implementation 'androidx.core:core-ktx:1.1.0'
  implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  implementation 'androidx.recyclerview:recyclerview:1.1.0'
  testImplementation 'junit:junit:4.12'
  androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  implementation 'com.squareup.picasso:picasso:2.71828'
  implementation 'com.github.bumptech.glide:glide:4.11.0'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
  api 'com.squareup.retrofit2:converter-gson:2.7.1'
  api 'io.reactivex.rxjava2:rxandroid:2.1.1'
  implementation 'com.squareup.retrofit2:adapter-rxjava:2.0.0'
  implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
  implementation project(':avatargenlib')
}
