import static org.briarproject.onionwrapper.OS.Linux import static org.briarproject.onionwrapper.OS.Windows import static org.briarproject.onionwrapper.OsUtils.currentOS plugins { id 'java-library' id 'com.vanniktech.maven.publish' version '0.18.0' } java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } dependencies { api project(':onionwrapper-core') def jna_version = '4.5.2' implementation "net.java.dev.jna:jna:$jna_version" implementation "net.java.dev.jna:jna-platform:$jna_version" testImplementation project(path: ':onionwrapper-core', configuration: 'testOutput') testImplementation 'junit:junit:4.13.2' if (currentOS == Linux || currentOS == Windows) { testImplementation "org.briarproject:tor-$currentOS.id:0.4.7.13-2" testImplementation "org.briarproject:obfs4proxy-$currentOS.id:0.0.14-tor2" testImplementation "org.briarproject:snowflake-$currentOS.id:2.5.1" } } mavenPublishing { pom { withXml { // Dependencies on other modules are represented in the POM with a groupId equal to // the project's name and an unspecified version. Rewrite them with the correct // groupId and version. Node pomNode = asNode() String name = pomNode.get('name').text() String groupId = pomNode.groupId.text() String version = pomNode.version.text() pomNode.dependencies.dependency.each() { node -> if (node.groupId.text() == name) { node.groupId.each() { n -> n.value = groupId } node.version.each() { n -> n.value = version } } } } } }