plugins {
    id "java-gradle-plugin"
    id "java"
    id "groovy"
}

sourceCompatibility = JavaVersion.VERSION_11

repositories {
    jcenter()
    gradlePluginPortal()
    mavenCentral()
    maven { url 'https://repo.spring.io/plugins-release/' }
}

sourceSets {
    main {
        java {
            srcDirs = []
        }
        groovy {
            srcDirs += ["src/main/java"]
        }
    }
}

gradlePlugin {
    plugins {
        checkAntoraVersion {
            id = "org.springframework.antora.check-version"
            implementationClass = "org.springframework.gradle.antora.AntoraVersionPlugin"
        }
        managementConfiguration {
            id = "io.spring.convention.management-configuration"
            implementationClass = "io.spring.gradle.convention.ManagementConfigurationPlugin"
        }
        sagan {
            id = "org.springframework.security.sagan"
            implementationClass = "org.springframework.gradle.sagan.SaganPlugin"
        }
        githubMilestone {
            id = "org.springframework.github.milestone"
            implementationClass = "org.springframework.gradle.github.milestones.GitHubMilestonePlugin"
        }
        propdeps {
            id = "org.springframework.propdeps"
            implementationClass = "org.springframework.gradle.propdeps.PropDepsPlugin"
        }
    }
}

configurations {
    implementation {
        exclude module: 'groovy-all'
    }
}

dependencies {
    implementation 'com.google.code.gson:gson:2.8.8'
    implementation 'net.sourceforge.saxon:saxon:9.1.0.8'
    implementation 'org.yaml:snakeyaml:1.30'
    implementation localGroovy()

    implementation 'io.github.gradle-nexus:publish-plugin:1.1.0'
    implementation 'io.spring.gradle:dependency-management-plugin:1.0.10.RELEASE'
    implementation 'io.projectreactor:reactor-core:3.4.11'
    implementation 'com.apollographql.apollo:apollo-runtime:2.4.5'
    implementation 'com.github.ben-manes:gradle-versions-plugin:0.38.0'
    implementation 'com.github.spullara.mustache.java:compiler:0.9.10'
    implementation 'io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.34'
    implementation 'io.spring.nohttp:nohttp-gradle:0.0.9'
    implementation 'net.sourceforge.htmlunit:htmlunit:2.37.0'
    implementation 'org.hidetake:gradle-ssh-plugin:2.10.1'
    implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.29.0'
    implementation 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1'

    testImplementation platform('org.junit:junit-bom:5.8.1')
    testImplementation "org.junit.jupiter:junit-jupiter-api"
    testImplementation "org.junit.jupiter:junit-jupiter-params"
    testImplementation "org.junit.jupiter:junit-jupiter-engine"
    testImplementation 'org.apache.commons:commons-io:1.3.2'
    testImplementation 'org.assertj:assertj-core:3.21.0'
    testImplementation 'org.mockito:mockito-core:3.12.4'
    testImplementation 'org.mockito:mockito-junit-jupiter:3.12.4'
    testImplementation 'com.squareup.okhttp3:mockwebserver:3.14.9'
}


test {
    onlyIf { !project.hasProperty("buildSrc.skipTests") }
    useJUnitPlatform()
}
