import groovy.io.FileType apply plugin: 'java-library' apply plugin: 'maven-publish' group = 'com.mojang' version = project.hasProperty('buildNumber') ? "${project.majorMinor}.${project.buildNumber}" : "${project.majorMinor}.0-SNAPSHOT" task wrapper(type: Wrapper) { gradleVersion = '4.0' } repositories { maven { url "https://libraries.minecraft.net" } mavenCentral() } dependencies { api 'com.google.guava:guava:21.0' testCompile 'junit:junit-dep:4.10' testCompile 'org.hamcrest:hamcrest-library:1.2.1' testCompile 'org.mockito:mockito-core:1.8.5' testCompile 'com.google.guava:guava-testlib:21.0' testCompile 'org.openjdk.jmh:jmh-core:1.19' testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.19' } task sourcesJar(type: Jar) { classifier = 'sources' from sourceSets.main.allSource } sourceSets { main { java { srcDirs = ['src/main/java'] } resources { srcDirs = ['src/main/resources'] } } test { java { srcDirs = ['src/test/java'] } resources { srcDirs = ['src/test/resources'] } } } artifacts { archives jar archives sourcesJar } test { testLogging { events "failed", "skipped" showStandardStreams = true showExceptions true } } publishing { publications { mavenJava(MavenPublication) { from components.java artifact sourcesJar } } } task report { doLast { println "##teamcity[buildNumber '${project.version}']" } } if (version.endsWith("SNAPSHOT")) { publishing.repositories { mavenLocal() } } else { publishing.repositories { maven { url "s3://minecraft-libraries/" authentication { awsIm(AwsImAuthentication) } } } }