plugins {
    id("com.android.application") version '8.10.0' apply false
    id("com.android.library") version '8.10.0' apply false
}

tasks.register('clean', Delete) {
    delete rootProject.buildFile
}

def needReplaceLocal = true

if (needReplaceLocal) {
    allprojects {
        configurations.configureEach {
            resolutionStrategy {
                dependencySubstitution {
                    substitute module('pub.doric:core') using project(":doric")
                    substitute module('pub.doric:devkit') using project(":devkit")
                    substitute module('pub.doric:jse') using project(":jse")
                }
            }
        }
    }
}

Properties properties = new Properties()
properties.load(project.rootProject.file('version.properties').newDataInputStream())
ext {
    UseWebViewOnly = false
    Version = properties.version
}

task publisCore dependsOn(":doric:publish") {
    println "doric published"
}

task publishDevKit dependsOn(publisCore, ":devkit:publish") {
    println "devkit published"
}

task PublishAll dependsOn(publisCore, publishDevKit) {
    println "All published"
}
