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

group 'com.microsoft.signalr.messagepack'

java
{
    withJavadocJar()
    withSourcesJar()
}

dependencies {
    implementation project(':core')
    implementation 'org.msgpack:msgpack-core:0.8.20'
    implementation 'org.msgpack:jackson-dataformat-msgpack:0.8.20'
}

base {
    archivesName = 'signalr-messagepack'
}

publishing {
    publications {
        release(MavenPublication) {
            from components.java

            artifactId 'signalr-messagepack'

            pom {
                packaging = 'jar'
                inceptionYear = '2020'
                url = 'https://github.com/dotnet/aspnetcore'
                name = groupId + ':' + artifactId
                description = 'MessagePack protocol implementation for ASP.NET Core SignalR Client for Java applications'
                licenses {
                    license {
                        name = 'MIT License'
                        url = 'https://opensource.org/licenses/MIT'
                        distribution = 'repo'
                    }
                }
                scm {
                    connection = 'scm:git:https://github.com/dotnet/aspnetcore.git'
                    developerConnection = 'scm:git:https://github.com/dotnet/aspnetcore.git'
                    url = 'https://github.com/dotnet/aspnetcore/tree/main'
                }
                developers {
                    developer {
                        id = 'microsoft'
                        name = 'Microsoft'
                    }
                }
            }
        }
    }
}

tasks.withType(GenerateMavenPom).all {
    destination = layout.buildDirectory.file("libs/signalr-messagepack-${project.version}.pom").get().asFile
}
