-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
80 lines (66 loc) · 1.64 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
plugins {
id 'java'
id 'checkstyle'
id 'maven-publish'
id 'signing'
id 'eclipse'
id 'idea'
}
group = 'org.monospark'
version = '1.2'
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
isCiServer = System.getenv().containsKey('JENKINS_HOME')
isSnapshot = version.endsWith('SNAPSHOT')
}
repositories {
mavenCentral()
maven {
url "http://repo.spongepowered.org/maven/"
}
}
configurations {
customCheckstyle
}
dependencies {
compile 'org.spongepowered:spongeapi:5.0.0-20160924.140951-128'
testCompile 'junit:junit:4.11'
testCompile 'org.mockito:mockito-core:1.10.19'
customCheckstyle 'com.puppycrawl.tools:checkstyle:6.13'
}
checkstyle {
//Only run checkstyle tests for main
sourceSets = Collections.singleton(sourceSets.main)
//Checkstyle config is not located at the default location, so it has to be changed
configFile = file('checkstyle/checkstyle.xml')
configProperties = [
'basedir': project.projectDir,
]
}
tasks.checkstyleMain {
//Use a custom version of checkstyle
checkstyleClasspath = files(configurations.customCheckstyle.files)
}
//Include the license file in the jar
jar {
from 'LICENSE.txt'
rename 'LICENSE.txt', 'spongematchers-license.txt'
}
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar, javadocJar, sourcesJar
}
if(isCiServer) {
apply from: 'publish.gradle'
}