plugins {
    id 'com.gradle.plugin-publish' version '1.3.1'
    id 'com.github.ben-manes.versions' version '0.52.0'
    id 'com.github.hierynomus.license' version '0.16.1'
}

group 'com.gluonhq'
version '1.0.28-SNAPSHOT'

java {
    toolchain.languageVersion = JavaLanguageVersion.of(11)
}

repositories {
    mavenCentral()
    gradlePluginPortal()
    maven {
        url "https://central.sonatype.com/repository/maven-snapshots/"
    }
}

dependencies {
    implementation gradleApi()

    testImplementation gradleTestKit()
    implementation 'com.gluonhq:substrate:0.0.68-SNAPSHOT'
    implementation 'org.openjfx:javafx-plugin:0.1.0'
}

gradlePlugin {
    plugins {
        gluonFXPlugin {
            id = 'com.gluonhq.gluonfx-gradle-plugin'
            displayName = 'GluonFX Plugin'
            description = 'GluonFX plugin allows to run JavaFX application on the JVM or to create their native images.'
            implementationClass = 'com.gluonhq.gradle.GluonFXPlugin'
            website = 'https://github.com/gluonhq/gluonfx-gradle-plugin'
            vcsUrl = 'https://github.com/gluonhq/gluonfx-gradle-plugin'
            tags.set([ 'java', 'javafx', 'gluon', 'client', 'substrate', 'graalvm', 'aot' ])
        }
    }
}

publishing {
    repositories {
        maven {
            url = "https://central.sonatype.com/repository/maven-snapshots/"
            def sonatypeUsername = providers.gradleProperty('sonatypeUsername')
            def sonatypePassword = providers.gradleProperty('sonatypePassword')
            if (sonatypeUsername.isPresent() && sonatypePassword.isPresent()) {
                credentials {
                    username = sonatypeUsername.get()
                    password = sonatypePassword.get()
                }
            }
        }
    }
}

license {
    skipExistingHeaders = true
    mapping {
        java = 'SLASHSTAR_STYLE'
    }
}
