This repository has been archived by the owner on Apr 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
173 lines (148 loc) · 5.41 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
plugins {
id 'com.github.ksoichiro.console.reporter' version '0.5.0'
}
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'signing'
apply plugin: 'maven'
group 'io.leonis'
version '0.0.8'
archivesBaseName = "subra"
rootProject.description = 'soccer is simple, but it is difficult to play simple'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
// for jamepad
maven { url "https://jitpack.io" }
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.compile
}
dependencies {
// delta-leonis
compile 'io.leonis:zosma:0.0.8'
compile 'io.leonis:algieba:0.0.6'
compile 'io.leonis:subra-protocol:0.0.2'
// ipc
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.github.WilliamAHartman:Jamepad:1.2'
// java impl
compile 'org.projectlombok:lombok:1.16.20'
// tests
testCompile 'org.testng:testng:6.13.1'
}
test {
useTestNG()
testLogging {
events "PASSED", "STARTED", "FAILED", "SKIPPED"
showStandardStreams = true
}
}
tasks.withType(Javadoc) {
ext.capturedOutput = [ ]
def listener = { ext.capturedOutput << it } as StandardOutputListener
logging.addStandardErrorListener(listener)
logging.addStandardOutputListener(listener)
options.addStringOption('Xdoclint:all', '-quiet')
doLast {
logging.removeStandardOutputListener(listener)
logging.removeStandardErrorListener(listener)
ext.capturedOutput.join('').with { output ->
if (output =~ /warning/) {
throw new RuntimeException("Javadoc warning found: \n" + output)
}
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar, sourcesJar
}
if (!project.hasProperty("signing.keyId") && System.getenv("signingKeyId") != null) {
allprojects { ext."signing.keyId" = System.getenv("signingKeyId") }
}
if (!project.hasProperty("signing.password") && System.getenv("signingPassword") != null) {
allprojects { ext."signing.password" = System.getenv("signingPassword") }
}
if (!project.hasProperty("signing.secretKeyRingFile") && System.getenv("signingSecretKeyRing") != null) {
def file = new File("$projectDir/secring.gpg")
file.createNewFile()
file.text = System.getenv("signingSecretKeyRing")
allprojects { ext."signing.secretKeyRingFile" = "$projectDir/secring.gpg" }
}
signing {
sign configurations.archives
}
if (project.hasProperty("sign")) {
signArchives.enabled = sign.toBoolean()
} else if (System.getenv("sign") != null) {
signArchives.enabled = System.getenv("sign").toBoolean()
} else {
signArchives.enabled = false
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
if (project.hasProperty("sonatypeUsername") && project.hasProperty("sonatypePassword")) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
} else if (System.getenv("sonatypeUsername") != null && System.getenv("sonatypePassword") != null) {
authentication(userName: System.getenv("sonatypeUsername"), password: System.getenv("sonatypePassword"))
}
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
if (project.hasProperty("sonatypeUsername") && project.hasProperty("sonatypePassword")) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
} else if (System.getenv("sonatypeUsername") != null && System.getenv("sonatypePassword") != null) {
authentication(userName: System.getenv("sonatypeUsername"), password: System.getenv("sonatypePassword"))
}
}
pom.project {
name 'subra'
packaging 'jar'
description 'soccer is simple, but it is difficult to play simple'
url 'https://github.com/delta-leonis/subra/'
licenses {
license {
name 'AGPL'
url 'https://github.com/delta-leonis/subra/blob/master/LICENSE'
distribution 'repo'
}
}
scm {
url 'https://github.com/delta-leonis/subra/'
connection 'scm:git:git://github.com/delta-leonis/subra.git'
developerConnection 'scm:git:ssh://[email protected]/delta-leonis/subra.git'
}
developers {
developer {
id 'romni'
name 'Rimon Oz'
}
developer {
id 'thumbnail'
name 'Jeroen de Jong'
}
developer {
id 'RyanMeulenkamp'
name 'Ryan Meulenkamp'
}
developer {
id 'ThomasHakkers'
name 'Thomas Hakkers'
}
}
}
}
}
}