brigadier/build.gradle
2017-12-12 09:56:02 +01:00

90 lines
No EOL
1.7 KiB
Groovy

import groovy.io.FileType
apply plugin: 'java-library'
apply plugin: 'maven'
version = '0.1.15'
group = 'com.mojang'
task wrapper(type: Wrapper) {
gradleVersion = '4.0'
}
repositories {
maven {
url "https://libraries.minecraft.net"
}
mavenCentral()
}
dependencies {
api 'com.google.guava:guava:21.0'
testImplementation 'junit:junit-dep:4.10'
testImplementation 'org.hamcrest:hamcrest-library:1.2.1'
testImplementation 'org.mockito:mockito-core:1.8.5'
testImplementation 'com.google.guava:guava-testlib:21.0'
}
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
}
}
def repoDir = new File(projectDir, "repo")
repoDir.mkdirs()
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://" + repoDir.absolutePath)
pom.project {
description 'Command Registration & Dispatch System'
url 'http://github.com/Mojang/brigadier'
}
}
}
doLast {
// Purge all annoying files that arent needed
repoDir.traverse(type: FileType.FILES, nameFilter: ~/.*\.(xml|xml\.sha1|md5)$/) {
it.delete()
}
}
}
clean.doLast {
repoDir.deleteDir()
}