plugins {
    // Apply the groovy Plugin to add support for Groovy.
    id 'groovy'

    // Apply the java-library plugin for API and implementation separation.
    id 'java-library'

    // Apply the intellij idea plugin, used below to download source and javadocs for dependencies (see idea { ... })
    id 'idea'

}

group = 'software.amazon.healthomics'
version = '0.1.2'

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

dependencies {
    // Use Groovy for building this library
    implementation 'org.codehaus.groovy:groovy-all:3.0.25'

    // This dependency is used internally, and not exposed to consumers on their own compile classpath.
    implementation 'org.codenarc:CodeNarc:3.4.0'

    testImplementation 'junit:junit:4.13.2'

    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

}

idea {
    module {
        downloadJavadoc = true
        downloadSources = true
    }
}

// Apply a specific Java toolchain to ease working on different environments.
java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}

tasks.named('test') {
    // Use JUnit Platform for unit tests.
    useJUnitPlatform()
}
