apply plugin: 'java-library'
apply plugin: 'com.github.johnrengelman.shadow'

dependencies {
    implementation 'com.google.code.gson:gson:2.10.1'
    implementation 'org.apache.logging.log4j:log4j-api:2.20.0'
    api 'org.ow2.asm:asm-tree:9.5'
}

jar {
    manifest {
        attributes([
                "Specification-Title": rootProject.name,
                "Specification-Vendor": "dogboy21",
                "Specification-Version": "1",
                "Implementation-Title": rootProject.name,
                "Implementation-Version": "${rootProject.version}",
                "Implementation-Vendor" : "dogboy21",
                "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
        ])
    }
}

shadowJar {
    dependencies {
        exclude(dependency('org.apache.logging.log4j:log4j-api'))
    }

    relocate 'com.google.gson', 'io.dogboy.serializationisbad.shadow.gson'
    relocate 'org.objectweb.asm', 'io.dogboy.serializationisbad.shadow.asm'
}

artifacts {
    archives shadowJar
}

build.dependsOn shadowJar
