plugins {
    id 'maven-publish'
    alias catalog.plugins.envelope
    alias catalog.plugins.kotlin.jvm
    alias catalog.plugins.multi.release.jar
}

ext {
    setProperty('jpms.module.name', 'net.woggioni.wson.cli')
}

dependencies {
    implementation catalog.kotlin.stdlib.jdk8
    implementation catalog.jcommander
    implementation catalog.slf4j.simple
    implementation rootProject
}

envelopeJar {
    mainClass = 'net.woggioni.wson.cli.MainKt'
    mainModule = 'net.woggioni.wson.cli'
}

java {
    modularity.inferModulePath = true
}

compileKotlin {
    kotlinOptions.with {
        jvmTarget = '1.8'
    }
}

publishing {
    repositories {
        maven {
            url = "https://mvn.woggioni.net/"
        }
    }
    publications {
        myDistribution(MavenPublication) {
            artifact envelopeJar
        }
    }
}

tasks.register('listConfigurations') {
    configurations.each {
        println(it.name)
    }
}
