// TODO: Use bazel instead of gradle for running the generated Compute client.

buildscript {
    repositories {
        mavenCentral()
    }
}

apply plugin: 'java'

description = 'GAPIC library for Discovery API'
group = 'com.google.cloud'
version = (findProperty('version') == 'unspecified') ? '0.0.0-SNAPSHOT' : version
sourceCompatibility = 1.7
targetCompatibility = 1.7

repositories {
    mavenCentral()
    mavenLocal()
}

compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

dependencies {
    compile 'com.google.api:gax:1.42.0'
    testCompile 'com.google.api:gax:1.42.0:testlib'
    compile 'com.google.api:gax-httpjson:0.59.0'
    testCompile 'com.google.api:gax-httpjson:0.59.0:testlib'
    testCompile 'junit:junit:4.13.2'
}

task smokeTest(type: Test) {
    filter {
        includeTestsMatching "*SmokeTest"
        setFailOnNoMatchingTests false
    }
}

test {
    testLogging {
        events "PASSED", "STARTED", "FAILED", "SKIPPED"
    }

    exclude "**/*SmokeTest*"
}

sourceSets {
    main {
        java {
            srcDir 'src/main/java'
        }
    }
}

clean {
    delete 'all-jars'
}

task allJars(type: Copy) {
    dependsOn test, jar
    into 'all-jars'
    // Replace with `from configurations.testRuntime, jar` to include test dependencies
    from configurations.runtime, jar
}
