plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'

    // https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple
    implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
    implementation group: 'com.github.docker-java', name: 'docker-java', version: '3.2.11'
    implementation group: 'org.jfree', name: 'jfreechart', version: '1.5.3'
}

jar {
    duplicatesStrategy = DuplicatesStrategy.INCLUDE
    //manifest {
    //    attributes 'Main-Class': 'parser.DatasetParser'
    //}
    //from {
    //    configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
    //}
}

task runTestClass(type: Exec) {
    dependsOn jar
    group = "Execution"
    description = "Run the mainClass from the output jar in classpath with ExecTask"
    commandLine "java", "-classpath", jar.archiveFile.get(), "analyzer.tests.TestMain"
}

test {
    useJUnitPlatform()
}