plugins { id "com.jfrog.bintray" version "1.7.3" } group 'onethreeseven' version '0.0.4-SNAPSHOT' allprojects { repositories { jcenter() mavenCentral() } apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'java' } dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' } ext.moduleName = 'onethreeseven.geo' compileJava { inputs.property("moduleName", moduleName) doFirst { options.compilerArgs = [ '--module-path', classpath.asPath, ] classpath = files() } } compileTestJava { inputs.property("moduleName", moduleName) doFirst { options.compilerArgs = [ '--module-path', classpath.asPath, '--add-modules', 'junit', '--add-reads', "$moduleName=junit", '--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath, ] classpath = files() } } test { inputs.property("moduleName", moduleName) doFirst { jvmArgs = [ '--module-path', classpath.asPath, '--add-modules', 'ALL-MODULE-PATH', '--add-reads', "$moduleName=junit", '--patch-module', "$moduleName=" + files(sourceSets.test.java.outputDir).asPath, ] classpath = files() } } jar { inputs.property("moduleName", moduleName) manifest { attributes( 'Automatic-Module-Name': moduleName, "Implementation-Title": project.name, "Implementation-Version": version, 'Built-By': System.getProperty('user.name'), 'Built-Date': new Date(), 'Built-JDK': System.getProperty('java.version')) } } jar.dependsOn(test) task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { classifier = "javadoc" from 'build/docs/javadoc' } artifacts { archives jar archives sourcesJar archives javadocJar } publishing { publications { MyPublication(MavenPublication) { from components.java groupId group artifactId project.name version version artifact sourcesJar artifact javadocJar } } } bintray { user = project.hasProperty('bintrayUser') ? project.bintrayUser : System.getenv('BINTRAY_USER') key = project.hasProperty('bintrayKey') ? project.bintrayKey : System.getenv('BINTRAY_KEY') publications = ['MyPublication'] publish = true //If version should be auto published after an upload pkg { repo = '137-geo' name = '137-geo' licenses = ['MIT'] desc = 'A tiny geography library in Java: map projections, coordinate conversion etc. Mostly refactored from Nasa WorldWind.' websiteUrl = 'https://github.com/lukehb/137-geo' issueTrackerUrl = 'https://github.com/lukehb/137-geo/issues' vcsUrl = 'https://github.com/lukehb/137-geo.git' labels = ['137', 'java', 'geo', 'gis', 'spatial', 'map', 'projection'] publicDownloadNumbers = true githubRepo = 'lukehb/137-geo' githubReleaseNotesFile = 'README.md' } }