
apply plugin: 'com.google.osdetector'

dependencies {
    testImplementation project(':netty-channel-unix')
    testImplementation project(':netty-channel-epoll')
    testImplementation project(':netty-testsuite')
    testImplementation project(':netty-handler')
    testImplementation testLibs.assertj
    testImplementation testLibs.rerunner.jupiter
    testRuntimeOnly project(path: ':netty-tcnative-boringssl-static', configuration: osdetector.classifier)
}

task nettyEpollLinuxX8664(type: Jar) {
    archiveBaseName.set('netty-channel-epoll-native')
    archiveClassifier.set('linux-x86_64')
    version rootProject.version
    from (sourceSets.main.output) {
        include 'META-INF/native/libnetty_transport_native_epoll_x86_64.so'
    }
}
assemble.dependsOn(nettyEpollLinuxX8664)

configurations {
    'linux-x86_64' {
        canBeConsumed = true
        canBeResolved = false
        extendsFrom runtimeOnly
    }
}

artifacts {
    'linux-x86_64'(nettyEpollLinuxX8664)
}

publishing {
    publications {
        publishNettyEpollLinuxX8664(MavenPublication) {
            groupId rootProject.group
            artifactId project.name
            version rootProject.version
            artifact nettyEpollLinuxX8664
            pom {
                artifactId = project.name
                name = project.name
                version = project.version
                description = rootProject.ext.description
                url = rootProject.ext.url
                inceptionYear = rootProject.ext.inceptionYear
                packaging = 'jar'
                organization {
                    name = rootProject.ext.organizationName
                    url = rootProject.ext.organizationUrl
                }
                developers {
                    developer {
                        id = 'jprante'
                        name = 'Jörg Prante'
                        email = 'joergprante@gmail.com'
                        url = 'https://xbib.org/joerg'
                    }
                }
                scm {
                    url = rootProject.ext.scmUrl
                    connection = rootProject.ext.scmConnection
                    developerConnection = rootProject.ext.scmDeveloperConnection
                }
                issueManagement {
                    system = rootProject.ext.issueManagementSystem
                    url = rootProject.ext.issueManagementUrl
                }
                licenses {
                    license {
                        name = rootProject.ext.licenseName
                        url = rootProject.ext.licenseUrl
                        distribution = 'repo'
                    }
                }
            }
        }
    }
}