plugins {
    id 'com.gradle.build-scan' version '2.3'
    id 'com.gradle.plugin-publish' version '0.10.1'
    id 'java-gradle-plugin'
}
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
if (JavaVersion.current().isJava9Compatible()) {
    compileJava.options.compilerArgs.addAll(['--release', '8'])
}

compileJava   {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
}

repositories {
    maven { url 'target/dependencies/' }
    mavenCentral()
    maven { url 'https://repo.gradle.org/gradle/libs-releases-local/' }
}

dependencies {
    compile "io.quarkus:quarkus-bootstrap-core:${version}"
    compile "io.quarkus:quarkus-devtools-common:${version}"
    compile "io.quarkus:quarkus-devtools-common-core:${version}"
    compile "io.quarkus:quarkus-development-mode:${version}"
    compile "io.quarkus:quarkus-creator:${version}"
    compile "org.gradle:gradle-tooling-api:5.5.1"

    testImplementation 'org.assertj:assertj-core:3.13.2'
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2'
    testImplementation 'org.junit.jupiter:junit-jupiter-params:5.5.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2'
}

test {
    testLogging {
        events "passed", "skipped", "failed"
    }
    useJUnitPlatform()
}

javadoc {
    options.addStringOption('encoding', 'UTF-8')
}

pluginBundle {
    website = 'https://quarkus.io/' 
    vcsUrl = 'https://github.com/quarkusio/quarkus' 
    tags = ['quarkus', 'quarkusio', 'graalvm'] 
}

gradlePlugin {
    plugins {
        quarkusPlugin {
            id = 'io.quarkus'
            implementationClass = 'io.quarkus.gradle.QuarkusPlugin'
            displayName = 'Quarkus Plugin'
            description = 'Builds a Quarkus application, and provides helpers to launch dev-mode, the Quarkus CLI, building of native images'
        }
    }
}

buildScan {
    //See also: https://docs.gradle.com/build-scan-plugin/
    termsOfServiceUrl = 'https://gradle.com/terms-of-service';
    termsOfServiceAgree = 'yes'
}
