plugins {
    id 'com.android.application'
}

android {
    defaultConfig {
        applicationId "pub.doric.demo"
        minSdkVersion 21
        compileSdk 35
        targetSdkVersion 35
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            assets.srcDirs = [project.getRootDir().getParent() + "/doric-demo/bundle"]
        }
    }
    namespace = "pub.doric.demo"
}

afterEvaluate {
    buildJSBundle.exec()
}

task buildJSBundle(type: Exec) {
    commandLine 'sh', project.getProjectDir().getParent() + "/../bundle.sh"
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation "com.google.android.material:material:1.1.0"
    if (rootProject.ext.UseWebViewOnly) {
        implementation("pub.doric:core:${rootProject.ext.Version}") {
            exclude group: 'com.github.penfeizhou', module: 'jsc4a'
        }
        implementation("pub.doric:devkit:${rootProject.ext.Version}") {
            exclude group: 'com.github.penfeizhou', module: 'jsc4a'
        }
        implementation "pub.doric:jse:${rootProject.ext.Version}"
    } else {
        implementation("pub.doric:core:${rootProject.ext.Version}")
        implementation("pub.doric:devkit:${rootProject.ext.Version}")
    }
    implementation "com.google.android.material:material:1.1.0"
    implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.5.0'
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    implementation 'com.github.bumptech.glide:annotations:4.11.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    //debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
}
