pluginManagement {
    plugins {
        id 'com.tngtech.jgiven.gradle-plugin' version "${version}"

    }

    repositories {
        gradlePluginPortal()
        google()
        maven {
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
        maven {
            url = "https://oss.sonatype.org/content/repositories/staging/"
        }
    }
}

plugins {
    id 'com.gradle.develocity' version '3.19.2'
}

dependencyResolutionManagement {
    versionCatalogs {
        junitVariableVersionLibs {
            from(files('gradle/libs.versions.toml'))
            def junitVersion = rootProject.hasProperty('junitVersion') ? rootProject.junitVersion : null
            if (junitVersion != null) {
                version("junit4-version", junitVersion)
            }
        }
    }
}

develocity{
    buildScan {
        termsOfUseUrl = 'https://gradle.com/terms-of-service'
        termsOfUseAgree = 'yes'
    }
}

rootProject.name = 'JGiven'

include ':jgiven-core',
        ':jgiven-maven-plugin',
        ':jgiven-junit',
        ':jgiven-spock',
        ':jgiven-spock2',
        ':jgiven-testng',
        ':jgiven-spring',
        ':jgiven-spring-junit4',
        ':jgiven-html-app',
        ':jgiven-html5-report',
        ':jgiven-tests',
        ':jgiven-examples',
        ':jgiven-junit5',
        ':jgiven-spring-junit5',
        ':jgiven-gradle-plugin'

def timingEnabled = System.getenv("JGivenTiming")

if (timingEnabled) {
    include ':jgiven-timing'
}

def release = System.env.RELEASE == "true"
def android = System.env.ANDROID == "true"
boolean hasAndroidSourcePath = (System.env.ANDROID_SDK_ROOT)

if ((android || release) && hasAndroidSourcePath) {
    include ':jgiven-android'
}

if (android && !release && hasAndroidSourcePath) {
    include ':jgiven-android-test'
}

if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_19)) {
    include ':jgiven-future-java-tests'
}