plugins {
    id 'com.android.application'
}

android {
    namespace 'com.parkpro.app'
    compileSdk 34

    defaultConfig {
        applicationId "com.parkpro.app"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    sourceSets {
        main {
            assets.srcDirs = ['src/main/assets']
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            applicationIdSuffix ".debug"
            debuggable true
        }
    }

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

task copyWebAssets(type: Copy) {
    from '../../app'
    into 'src/main/assets'
}

tasks.matching { it.name.startsWith("preBuild") }.all {
    dependsOn copyWebAssets
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.11.0'
    implementation 'androidx.webkit:webkit:1.10.0'
    implementation 'com.google.mlkit:text-recognition:16.0.0'
}
