plugins {
    id 'application'
    id 'headlessmc-modules'
}

def MAIN_CLASS = 'io.github.headlesshq.headlessmc.wrapper.Main'
application {
    mainClass = MAIN_CLASS
}

run {
    standardInput = System.in
}

module {
    name = 'headlessmc.launcher'
    access = ACC_OPEN
    // TODO: otherwise we include the gson module-info, which is also not nice
}

def javaFxVersion = '17.0.9'
version += '-' + javaFxVersion

dependencies {
    runtimeOnly project(':headlessmc-launcher-wrapper')
    jarLibs group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win'
    jarLibs group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac'
    jarLibs group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'linux'
    jarLibs group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'win'
    jarLibs group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'mac'
    jarLibs group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'linux'
    jarLibs group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'win'
    jarLibs group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'mac'
    jarLibs group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'linux'
    jarLibs group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win'
    jarLibs group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac'
    jarLibs group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux'
    jarLibs group: 'org.openjfx', name: 'javafx-swing', version: javaFxVersion, classifier: 'win'
    jarLibs group: 'org.openjfx', name: 'javafx-swing', version: javaFxVersion, classifier: 'mac'
    jarLibs group: 'org.openjfx', name: 'javafx-swing', version: javaFxVersion, classifier: 'linux'
    jarLibs group: 'org.openjfx', name: 'javafx-web', version: javaFxVersion, classifier: 'win'
    jarLibs group: 'org.openjfx', name: 'javafx-web', version: javaFxVersion, classifier: 'mac'
    jarLibs group: 'org.openjfx', name: 'javafx-web', version: javaFxVersion, classifier: 'linux'
    jarLibs group: 'org.openjfx', name: 'javafx-media', version: javaFxVersion, classifier: 'win'
    jarLibs group: 'org.openjfx', name: 'javafx-media', version: javaFxVersion, classifier: 'mac'
    jarLibs group: 'org.openjfx', name: 'javafx-media', version: javaFxVersion, classifier: 'linux'
}

shadowJar {
    dependsOn project(':headlessmc-launcher-wrapper')['shadowJar']
    excludes.remove("module-info.class")

    from project(':headlessmc-launcher-wrapper')['shadowJar']

    exclude("META-INF/maven/com.google.code.gson/**")
    exclude("LICENSE")
}
