/*
 * A set of generic services and utilities.
 *
 * Should have a very small set of dependencies, and should be appropriate to embed in an external
 * application (eg as part of the tooling API).
 */

import java.util.concurrent.Callable

plugins {
    `java-library`
    id("classycle")
}

val javaVersion: JavaVersion by rootProject.extra
val generatedTestResourcesDir: File by extra
val buildReceiptPackage: String by rootProject.extra


java {
    sourceCompatibility = if (javaVersion.isJava9Compatible) JavaVersion.VERSION_1_6 else JavaVersion.VERSION_1_5
}

dependencies {
    compile(project(":distributionsDependencies"))

    api(library("guava"))
    api(library("jsr305"))
    api(library("fastutil"))

    implementation(library("slf4j_api"))
    implementation(library("commons_lang"))
    implementation(library("commons_io"))
    implementation(library("jcip"))

    jmh(library("bouncycastle_provider")) {
        version {
            prefer(libraries["bouncycastle_provider"]!!["version"])
        }
    }
}

testFixtures {
    from(":core")
}

val buildReceiptResource by tasks.creating(Copy::class) {
    from(Callable { tasks.getByPath(":createBuildReceipt").outputs.files })
    destinationDir = file("$generatedTestResourcesDir/$buildReceiptPackage")
}

java {
    sourceSets {
        "main" {
            output.dir(mapOf("builtBy" to buildReceiptResource), generatedTestResourcesDir)
        }
    }
}




/*
 * A set of generic services and utilities.
 *
 * Should have a very small set of dependencies, and should be appropriate to embed in an external
 * application (eg as part of the tooling API).
 */

import java.util.concurrent.Callable

plugins {
    `java-library`
    id("classycle")
}

val javaVersion: JavaVersion by rootProject.extra
val generatedTestResourcesDir: File by extra
val buildReceiptPackage: String by rootProject.extra


java {
    sourceCompatibility = if (javaVersion.isJava9Compatible) JavaVersion.VERSION_1_6 else JavaVersion.VERSION_1_5
}

dependencies {
    compile(project(":distributionsDependencies"))

    api(library("guava"))
    api(library("jsr305"))
    api(library("fastutil"))

    implementation(library("slf4j_api"))
    implementation(library("commons_lang"))
    implementation(library("commons_io"))
    implementation(library("jcip"))

    jmh(library("bouncycastle_provider")) {
        version {
            prefer(libraries["bouncycastle_provider"]!!["version"])
        }
    }
}

testFixtures {
    from(":core")
}

jmh {
    withGroovyBuilder {
        setProperty("include", listOf("HashingAlgorithmsBenchmark"))
    }
}

val buildReceiptResource by tasks.creating(Copy::class) {
    from(Callable { tasks.getByPath(":createBuildReceipt").outputs.files })
    destinationDir = file("$generatedTestResourcesDir/$buildReceiptPackage")
}

java {
    sourceSets {
        "main" {
            output.dir(mapOf("builtBy" to buildReceiptResource), generatedTestResourcesDir)
        }
    }
}




Configure `jmh` extension dynamically via `withGroovyBuilder`
Configure `jmh` extension dynamically via `withGroovyBuilder`

Since the extension type is not available to the script.

robinverduijn/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,blindpirate/gradle,blindpirate/gradle,lsmaira/gradle,robinverduijn/gradle,gradle/gradle,robinverduijn/gradle,gradle/gradle,gradle/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,gradle/gradle,blindpirate/gradle,lsmaira/gradle,blindpirate/gradle,robinverduijn/gradle,lsmaira/gradle,robinverduijn/gradle,blindpirate/gradle,blindpirate/gradle,gradle/gradle,lsmaira/gradle,lsmaira/gradle,lsmaira/gradle,robinverduijn/gradle,lsmaira/gradle,blindpirate/gradle,blindpirate/gradle,robinverduijn/gradle,blindpirate/gradle,gradle/gradle,blindpirate/gradle,lsmaira/gradle,lsmaira/gradle,lsmaira/gradle