plugins {
  id 'com.android.application'
  id 'kotlin-android'
}

android {
  compileSdk 34

  defaultConfig {
    applicationId "io.getstream.chat.virtualevent"
    namespace "io.getstream.chat.virtualevent"
    minSdk 26
    targetSdk 34
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  }

  File signFile = rootProject.file('.sign/keystore.properties')
  if (signFile.exists()) {
    Properties properties = new Properties()
    properties.load(new FileInputStream(signFile))
    signingConfigs {
      release {
        storeFile rootProject.file(properties['keystore'])
        storePassword properties['storePassword']
        keyAlias properties['keyAlias']
        keyPassword properties['keyPassword']
      }
    }
  } else {
    signingConfigs {
      release {
        storeFile rootProject.file('.sign/debug.keystore')
        storePassword 'android'
        keyAlias 'androiddebugkey'
        keyPassword 'android'
      }
    }
  }

  signingConfigs.debug {
    storeFile rootProject.file('.sign/debug.keystore')
    storePassword 'android'
    keyAlias 'androiddebugkey'
    keyPassword 'android'
  }

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

  compileOptions {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
  }

  kotlinOptions {
    jvmTarget = '17'
  }

  buildFeatures {
    viewBinding true
  }
}

dependencies {
  // Stream SDK dependency
  implementation "io.getstream:stream-chat-android-ui-components:6.1.1"
  implementation "io.getstream:stream-chat-android-state:6.1.1"
  implementation "io.getstream:stream-chat-android-offline:6.1.1"

  implementation libs.androidxCoreKtx
  implementation libs.androidxAppCompat
  implementation libs.materialComponents
  implementation libs.androidxConstraintLayout
  implementation libs.navigationFragmentKtx
  implementation libs.navigationUiKtx
  implementation libs.androidxLifecycleLiveData
  implementation libs.androidxLifecycleViewModel
  implementation libs.exoplayerCore
  implementation libs.exoplayerUi
  implementation libs.lottie
}
