// // This file is to be applied to every subproject. // apply plugin: 'java' apply plugin: 'maven' String mavenGroupId = 'org.openzen.zenscript' String mavenVersion = '1.0-SNAPSHOT' sourceCompatibility = '1.8' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' repositories { mavenCentral(); // You may define additional repositories, or even remove "mavenCentral()". // Read more about repositories here: // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories } dependencies { // Adding dependencies here will add the dependencies to each subproject. testCompile group: 'junit', name: 'junit', version: '4.10' compile 'net.sf.trove4j:trove4j:3.0.3' } String mavenArtifactId = name group = mavenGroupId version = mavenVersion task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') { classifier = 'sources' from sourceSets.main.allSource } artifacts { archives jar archives sourcesJar } configure(install.repositories.mavenInstaller) { pom.project { groupId = mavenGroupId artifactId = mavenArtifactId version = mavenVersion } } task createFolders(description: 'Creates the source folders if they do not exist.') doLast { sourceSets*.allSource*.srcDirs*.each { File srcDir -> if (!srcDir.isDirectory()) { println "Creating source folder: ${srcDir}" srcDir.mkdirs() } } }