apply plugin: 'java'
apply plugin: 'kotlin'

buildscript {
    ext.asm_version = '5.1'
    ext.logback_version = '1.2.3'
}

dependencies {
    // Asm: bytecode manipulation library.
    compile "org.ow2.asm:asm:$asm_version"
    compile "org.ow2.asm:asm-tree:$asm_version"
    compile "org.ow2.asm:asm-util:$asm_version"
    compile "org.ow2.asm:asm-commons:$asm_version"

    // JOptSimple: command line option parsing
    compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version"

    // Simple Logging Facade: makes the code independent of the chosen logging framework.
    compile "org.slf4j:slf4j-api:$slf4j_version"
    compile "ch.qos.logback:logback-classic:$logback_version"

    testCompile "junit:junit:$junit_version"
}

task standaloneJar(type: Jar) {
    // Create a fat jar by packing all deps into the output
    from {
        configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
    }
    with jar
    manifest {
        attributes(
                'Main-Class': 'net.corda.sandbox.tools.SandboxCreator',
                'Automatic-Module-Name': 'net.corda.sandbox.creator'
        )
    }
    archiveName "corda-sandbox-creator-${version}.jar"
}