plugins { id 'java-library' } java { ext.javaSourceVer = project.hasProperty('javaSourceVer') ? JavaVersion.toVersion(project.getProperty('javaSourceVer')) : JavaVersion.VERSION_1_8 ext.javaTargetVer = project.hasProperty('javaTargetVer') ? JavaVersion.toVersion(project.getProperty('javaTargetVer')) : JavaVersion.VERSION_1_8 sourceCompatibility = ext.javaSourceVer targetCompatibility = ext.javaTargetVer } repositories { maven { url 'https://maven.google.com' } mavenCentral() maven { url 'https://kotlin.bintray.com/kotlinx' } jcenter() } dependencies { // https://mvnrepository.com/artifact/com.android.tools.build/manifest-merger compile group: 'com.android.tools.build', name: 'manifest-merger', version: '30.2.2' } sourceSets { main { java { srcDirs = ["src"] } } } jar { duplicatesStrategy = 'exclude' manifest { attributes 'Main-Class': 'com.xamarin.manifestmerger.Main' } from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } { // Exclude native jnidispatch content to simplify installer signing and notarization exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA', 'com/sun/jna/**/*jnidispatch*' } archiveName 'manifestmerger.jar' }