plugins {
    id 'com.gradle.plugin-publish' version '1.2.1'
    id 'groovy'
}

repositories {
    mavenCentral()
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(8)
    }
}

group = 'com.dorongold.plugins'
version = '4.0.1'
description = "Gradle plugin that adds a 'taskTree' task that prints task dependency tree"

dependencies {
    // mandatory dependencies for using Spock
    implementation platform('org.codehaus.groovy:groovy-bom:3.0.21')
    implementation 'org.codehaus.groovy:groovy'

    implementation 'org.apache.commons:commons-lang3:3.14.0'

    testImplementation platform("org.spockframework:spock-bom:2.3-groovy-3.0") {
        exclude group: 'org.codehaus.groovy'
    }
    testImplementation "org.spockframework:spock-core"
    testImplementation "org.spockframework:spock-junit4"  // you can remove this if your code does not rely on old JUnit 4 rules
    testImplementation 'com.netflix.nebula:nebula-test:10.6.1'
    testImplementation 'commons-io:commons-io:2.16.1'
}

gradlePlugin {
    website = 'https://github.com/dorongold/gradle-task-tree'
    vcsUrl = 'https://github.com/dorongold/gradle-task-tree.git'

    plugins {
        taskTreePlugin {
            id = 'com.dorongold.task-tree'
            displayName = 'Gradle Task Tree Plugin'
            description = "Gradle plugin that adds a 'taskTree' task that prints task dependency tree"
            tags.addAll('task', 'tree', 'dependencies', 'dependency')
            implementationClass = 'com.dorongold.gradle.tasktree.TaskTreePlugin'
        }
    }
}

test {
    useJUnitPlatform()
    testLogging {
//        showStandardStreams = true
        events "passed", "skipped", "failed"
        exceptionFormat = 'full'
    }
}
