plugins {
    id "java-library"
    id "ivy-publish"
}

java {
    withJavadocJar()
    withSourcesJar()
        toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}

dependencies {
    compileOnly libs.jdt.annotations

    api gradleApi()
}

task printVersion{
    doLast {
        println "project: $project.group:$project.name:$project.version"
        println "jar: ${->jar.archiveFileName.get()}"
    }
}

publishing {
    repositories {
        ivy {
            url "${System.properties["user.home"]}/ivy-repo"
        }
    }
    publications {
        ivy(IvyPublication) {
            from components.java
            descriptor.description {
                text = providers.provider({ description })
            }
        }
    }
}