-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
254 lines (220 loc) · 7.75 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
buildscript {
repositories {
mavenLocal()
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.spongepowered:event-impl-gen:${project.eventImplGenPluginVersion}"
}
}
plugins {
id 'org.spongepowered.plugin' version '0.9.0'
id 'net.minecrell.licenser' version '0.4.1'
id 'nu.studer.jooq' version '3.0.2'
id 'com.github.johnrengelman.shadow' version '2.0.4'
id 'maven'
id 'signing'
}
apply plugin: "org.spongepowered.event-impl-gen"
group = project.group
version = project.version
description = project.description
defaultTasks 'clean', 'updateLicenses', 'build'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
archivesBaseName = project.name.toLowerCase()
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'oss-sonatype-public'
url = 'https://oss.sonatype.org/content/repositories/public/'
}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
}
dependencies {
compile "com.google.inject.extensions:guice-assistedinject:${project.assistedInjectVersion}"
compile "org.checkerframework:checker-qual:${project.checkerQualVersion}"
compile "com.almuradev:droplet:${project.dropletVersion}"
compile "net.objecthunter:exp4j:${project.exp4JVersion}"
compile "net.kyori:feature:${project.featureVersion}"
compile "net.kyori:fragment:${project.fragmentVersion}"
compile "com.google.inject.extensions:guice-multibindings:${project.guiceMultibindingsVersion}"
compile "org.jdom:jdom2:${project.jdom2Version}"
compile "org.jooq:jooq:${project.jooqVersion}"
compile "org.jooq:jooq-meta:${project.jooqVersion}"
compile "org.jooq:jooq-codegen:${project.jooqVersion}"
compile "net.kyori:lunar:${project.lunarVersion}"
compile "net.kyori:membrane:${project.membraneVersion}"
compile "org.spongepowered:spongeapi:${project.spongeAPIVersion}"
compile "com.almuradev:toolbox:${project.toolboxVersion}"
compile "net.kyori:violet:${project.violetVersion}"
compile "net.kyori:xml:${project.xmlVersion}"
jooqRuntime "org.jooq:jooq-meta-extensions:${project.jooqVersion}"
testCompile "junit:junit:${project.junitVersion}"
}
license {
header project.file('header.txt')
include '**/*.java'
exclude 'src/main/generated/**'
newLine false
}
genEventImpl {
// The full qualified class name of the factory
outputFactory = 'org.inspirenxe.skills.api.event.SkillsEventFactory'
// The path to your event interfaces
include 'org/inspirenxe/skills/api/event/*'
exclude 'org/inspirenxe/skills/api/event/ExperienceEvent.java'
}
def generatedDir = 'src/main/generated'
sourceSets {
main {
java {
srcDirs += [generatedDir]
}
}
}
build.dependsOn 'shadowJar'
shadowJar {
dependencies {
include(dependency("com.almuradev:droplet"))
include(dependency("com.almuradev:toolbox"))
include(dependency('net.kyori:feature'))
include(dependency('net.kyori:fragment'))
include(dependency('net.kyori:lunar'))
include(dependency('net.kyori:membrane'))
include(dependency('net.kyori:violet'))
include(dependency('net.kyori:xml'))
include(dependency('org.jdom:jdom2'))
include(dependency('org.checkerframework:checker-qual'))
include(dependency('com.google.inject.extensions:guice-assistedinject'))
include(dependency('com.google.inject.extensions:guice-multibindings'))
include(dependency("net.objecthunter:exp4j"))
include(dependency("org.jooq:jooq"))
include(dependency("org.jooq:jooq-meta"))
include(dependency("org.jooq:jooq-codegen"))
}
classifier = null
}
jooq {
version = project.jooqVersion
edition = project.jooqEdition
ddl(sourceSets.main) {
generator {
database {
name = 'org.jooq.meta.extensions.ddl.DDLDatabase'
properties {
property {
key = 'scripts'
value = 'src/main/resources/db/database.sql'
}
}
inputSchema = 'PUBLIC'
outputSchemaToDefault = true
}
generate {
relations = true
deprecated = false
records = true
immutablePojos = false
fluentSetters = true
}
target {
packageName = 'org.inspirenxe.skills.generated'
directory = generatedDir
}
}
}
}
task generateDatabaseClasses() {}
generateDatabaseClasses.dependsOn 'generateDdlJooqSchemaSource'
task cleanDatabaseClasses() {
doLast {
project.file(generatedDir).deleteDir()
}
}
generateDdlJooqSchemaSource.dependsOn 'cleanDatabaseClasses'
project.tasks.getByName('compileJava').dependsOn -= 'generateDdlJooqSchemaSource'
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xlint:all', '-Xlint:-path', '-parameters']
options.deprecation = true
options.encoding = 'UTF-8'
}
if (JavaVersion.current().isJava8Compatible() || JavaVersion.current().isJava9Compatible()) {
tasks.withType(Javadoc) {
// disable the crazy super-strict doclint tool in Java 8
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task apiJar(type: Jar) {
classifier = 'api'
from (sourceSets.main.output) {
include "org/inspirenxe/skills/api/**"
}
}
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 apiJar
archives sourcesJar
archives javadocJar
}
signing {
required { !project.version.endsWith('-SNAPSHOT') && gradle.taskGraph.hasTask(':uploadArchives') }
sign configurations.archives
}
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
description 'Shared code useful for anyone working with the Sponge ecosystem'
name project.name
url 'https://github.com/AlmuraDev/Skills/'
developers {
developer {
name 'zidane'
}
}
issueManagement {
system 'GitHub Issues'
url 'https://github.com/AlmuraDev/Skills/issues'
}
licenses {
license {
name 'MIT License'
url 'https://opensource.org/licenses/MIT'
}
}
scm {
connection 'scm:git@github.com:AlmuraDev/Skills.git'
developerConnection 'scm:git@github.com:AlmuraDev/Skills.git'
url 'https://github.com/AlmuraDev/Skills/'
}
}
}
}
}
}