
plugins {
    id 'org.beryx.jlink' version '2.26.0'
    id "org.moditect.gradleplugin" version "1.0.0-rc3"
    id "org.asciidoctor.jvm.convert" version "3.3.2"
    id 'org.jreleaser' version '1.6.0'
    id("com.netflix.nebula.ospackage") version "11.3.0"
}

repositories {
    mavenCentral()
}


version = rootProject.versionString

task dist(type: DefaultTask) {}

clean {
    setDelete(Set.of())
    doLast {
        fileTree(dir: project.buildDir).exclude("jreleaser/**").visit { FileVisitDetails details ->
            delete details.file
        }
    }
}

distTar {
    enabled = false;
}

distZip {
    enabled = false;
}

apply from: 'base.gradle'
apply from: 'jpackage.gradle'

if (rootProject.fullVersion) {
    apply from: 'cli.gradle'
    apply from: 'portable.gradle'
    apply from: 'proguard.gradle'
    apply from: 'jreleaser.gradle'
    apply from: 'choco.gradle'
    //apply from: 'flatpak.gradle'

    if (org.gradle.internal.os.OperatingSystem.current().isLinux()) {
        apply from: 'linux_packages.gradle'
    } else if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
        apply from: 'msi.gradle'
    } else if (org.gradle.internal.os.OperatingSystem.current().isMacOsX()) {
        apply from: 'pkg.gradle'
    }

    apply from: 'test.gradle'
}