plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'com.google.devtools.ksp'
    id 'com.jetstart.hot-reload' version '1.0.0'
    id 'org.jetbrains.kotlin.plugin.compose'
}

android {
    namespace '{{PACKAGE_NAME}}'
    compileSdk 34

    defaultConfig {
        applicationId "{{PACKAGE_NAME}}"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0.0"

        // JetStart injected fields
        buildConfigField "String", "JETSTART_SERVER_URL", "\"\"" // injected by: jetstart dev
        buildConfigField "String", "JETSTART_SESSION_ID", "\"\"" // injected by: jetstart dev
        // End JetStart fields
    }

    buildTypes {
        debug {
            debuggable true
        }
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            // Signing config is injected by `jetstart build --sign` via keystore.properties
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }

    kotlinOptions {
        jvmTarget = '17'
    }

    buildFeatures {
        compose true
        buildConfig true  // Required for JetStart hot reload
    }


}

dependencies {
    implementation 'androidx.core:core-ktx:1.12.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
    implementation 'androidx.activity:activity-compose:1.8.1'
    implementation platform('androidx.compose:compose-bom:2023.10.01')
    implementation 'androidx.compose.ui:ui'
    implementation 'androidx.compose.ui:ui-graphics'
    implementation 'androidx.compose.ui:ui-tooling-preview'
    implementation 'androidx.compose.material3:material3'

    // Room
    implementation 'androidx.room:room-runtime:2.6.1'
    implementation 'androidx.room:room-ktx:2.6.1'
    ksp 'androidx.room:room-compiler:2.6.1'
    
    // Gson
    implementation 'com.google.code.gson:gson:2.10.1'

    // JetStart Hot Reload Runtime 
    implementation 'com.jetstart:hot-reload-runtime:1.0.0'

    implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2"
    
}
