plugins {
    id 'java'
    id 'maven-publish'
}

group 'com.astarivi.kaizolib'
version '2.0'

java {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
}

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

dependencies {
    // Logging
    implementation 'org.tinylog:tinylog-api:2.7.0'
    runtimeOnly 'org.tinylog:tinylog-impl:2.7.0'
    runtimeOnly 'org.tinylog:slf4j-tinylog:2.7.0'

    // Jackson
    //noinspection GradleDependency
    implementation('com.fasterxml.jackson.core:jackson-databind:2.13.5') {
        because 'we want Android 6 compatibility, do not upgrade'
    }
    //noinspection GradleDependency
    implementation 'com.fasterxml.jackson.core:jackson-core:2.13.5'
    //noinspection GradleDependency
    implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.5'
    //noinspection GradleDependency
    implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.13.5'
    implementation 'com.fasterxml.woodstox:woodstox-core:6.6.2'
    implementation 'javax.xml.stream:stax-api:1.0-2'
    implementation 'org.codehaus.woodstox:stax2-api:4.2.2'

    // Misc
    implementation 'org.jsoup:jsoup:1.20.1'
    implementation 'org.jetbrains:annotations:26.0.2'

    implementation 'com.squareup.okhttp3:okhttp:4.12.0'

    testImplementation platform('org.junit:junit-bom:5.12.2')
    testImplementation 'org.junit.jupiter:junit-jupiter'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

test {
    useJUnitPlatform()
    testLogging {
        events "passed", "skipped", "failed"
    }
}

publishing {
    publications {
        release(MavenPublication) {
            groupId = 'com.github.astarivi'
            artifactId = 'kaizolib'
            version = '1.2'

            from components.java

            pom {
                licenses {
                    license {
                        name = 'MIT License'
                        url = 'https://github.com/astarivi/Kaizoyu/blob/975c436925e2f5e00b554bd667c52c2057c1fd08/service/LICENSE'
                    }
                }
            }
        }
    }
}