// Gradle Groovy DSL build script. A parsing fixture: no plugin resolution, no dependency
// download, and every coordinate is a fictional example-org artifact.

plugins {
    id 'java-library'
    id 'jacoco'
    id 'com.example.internal.conventions' version '2.3.0'
}

group = 'com.example.orders'
version = '1.4.0'
description = 'Fictional orders library used as a build-file fixture.'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
    withSourcesJar()
}

repositories {
    maven {
        name = 'example-internal'
        url = uri('https://maven.example.invalid/releases')
    }
}

dependencies {
    api 'com.example.lib:core:3.2.1'
    implementation 'com.example.lib:http:1.8.0'
    compileOnly 'com.example.lib:annotations:1.0.0'
    testImplementation 'com.example.test:harness:4.1.0'
    testRuntimeOnly 'com.example.test:runner:4.1.0'
}

tasks.named('test') {
    useJUnitPlatform()
    maxParallelForks = 2
    testLogging {
        events 'passed', 'skipped', 'failed'
    }
    finalizedBy tasks.named('jacocoTestReport')
}

tasks.register('printVersion') {
    doLast {
        println "orders ${project.version}"
    }
}

jacocoTestReport {
    reports {
        xml.required = true
        html.required = false
    }
}
