// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        kotlin_version = '1.7.10'
    }
    repositories {
        mavenCentral()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:8.8.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

def myVersion = file('../../VERSION').text.trim()
allprojects {
    group 'com.tencent.wcdb'
    version myVersion

    repositories {
        mavenCentral()
        google()
    }
}

tasks.register('publishAllToMavenLocal') {
    group = 'publishing'
    dependsOn gradle.includedBuild('annotation').task(':publishToMavenLocal')
    dependsOn gradle.includedBuild('builder').task(':compiler:publishToMavenLocal')
    dependsOn gradle.includedBuild('builder').task(':gradle-plugin:publishToMavenLocal')
    dependsOn tasks.findByPath(':main:publishToMavenLocal')
    dependsOn tasks.findByPath(':compat:publishToMavenLocal')
}

tasks.register('publishAll') {
    group = 'publishing'
    dependsOn gradle.includedBuild('annotation').task(':publish')
    dependsOn gradle.includedBuild('builder').task(':compiler:publish')
    dependsOn gradle.includedBuild('builder').task(':gradle-plugin:publish')
    dependsOn tasks.findByPath(':main:publish')
    dependsOn tasks.findByPath(':compat:publish')
}
