-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
189 lines (161 loc) · 4.78 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
buildscript {
repositories {
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
}
}
plugins {
id "net.minecrell.licenser" version "0.4"
id "com.github.johnrengelman.shadow" version "5.2.0"
id "org.spongepowered.plugin" version "0.9.0"
id "net.minecrell.vanillagradle.server" version "2.2-6"
id "java-library"
id "maven-publish"
}
sponge.plugin.id = pluginId
group = pluginGroup
version = pluginVersion
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
maven {
url "https://repo.ichorpowered.com/repository/maven-public"
}
}
license {
header = file("HEADER.txt")
newLine = false
ext {
name = "ProtocolControl"
organization = "IchorPowered"
url = "http://ichorpowered.com"
}
include("**/*.java", "**/*.groovy", "**/*.kt")
}
dependencies {
compile 'net.kyori:mu:1.0.0-SNAPSHOT'
compile 'net.kyori:violet:1.2.0-SNAPSHOT'
compile 'net.kyori:indigo:1.0.0-SNAPSHOT'
compile "net.kyori:event-method-asm:3.0.0"
compileOnly "org.spongepowered:spongeapi:7.2.0"
annotationProcessor "org.spongepowered:spongeapi:7.2.0"
}
tasks.withType(JavaCompile) {
options.compilerArgs += ["-Xlint:all", "-Xlint:-path", "-parameters"]
options.deprecation = true
options.encoding = "UTF-8"
}
minecraft {
version = "1.12.2"
mappings = "snapshot_20180808"
makeObfSourceJar = false
}
jar {
manifest.attributes(
"Specification-Title": "ProtocolControl",
"Specification-Vendor": "IchorPowered",
"Specification-Version": 1,
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"FMLAT": "protocolcontrol_at.cfg",
"ForceLoadAsMod": true
)
}
javadoc {
options.encoding = "UTF-8"
options.charSet = "UTF-8"
options.links(
"http://www.slf4j.org/apidocs/",
"https://google.github.io/guava/releases/21.0/api/docs/",
"https://google.github.io/guice/api-docs/4.1/javadoc/",
"http://asm.ow2.org/asm50/javadoc/user/"
)
// Disable the crazy super-strict doclint tool in Java 8
options.addStringOption("Xdoclint:none", "-quiet")
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
}
task javadocsJar(type: Jar) {
from javadoc
classifier = "javadoc"
}
shadowJar {
classifier = "shaded"
dependsOn reobfJar
dependencies {
include(dependency('net.kyori:mu'))
include(dependency('net.kyori:violet'))
include(dependency('net.kyori:indigo'))
include(dependency("net.kyori:event-api"))
include(dependency("net.kyori:event-method"))
include(dependency("net.kyori:event-method-asm"))
include(dependency('net.kyori:examination-api'))
include(dependency('com.google.inject.extensions:guice-assistedinject'))
include(dependency('com.google.inject.extensions:guice-multibindings'))
}
relocate("net.kyori", "com.ichorpowered.protocolcontrol.lib.kyori")
exclude "dummyThing"
}
def ichorpoweredUsername = System.getenv("ICHORPOWERED_USERNAME")
def ichorpoweredPassword = System.getenv("ICHORPOWERED_PASSWORD")
tasks.<PublishToMavenRepository>withType(PublishToMavenRepository.class).configureEach {
onlyIf {
(repository == publishing.repositories["GitHubPackages"]
|| (ichorpoweredUsername != null && ichorpoweredPassword != null))
}
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/ichorpowered/protocolcontrol"
credentials {
username = project.findProperty("gpr.user") as String ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") as String ?: System.getenv("GITHUB_TOKEN")
}
}
maven {
name = "IchorpoweredRepo"
url = "https://repo.ichorpowered.com/repository/maven-ichorpowered"
credentials {
username = ichorpoweredUsername
password = ichorpoweredPassword
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = 'protocolcontrol'
from components.java
artifact shadowJar
artifact sourcesJar
artifact javadocsJar
pom {
name = "protocolcontrol"
description = "A minimal packet manipulation library for Sponge."
url = "https://github.com/ichorpowered/protocolcontrol"
licenses {
license {
name = "MIT"
url = "https://opensource.org/licenses/MIT"
}
}
scm {
connection = "scm:git:git://github.com/ichorpowered/protocolcontrol.git"
developerConnection = "scm:git:ssh://github.com/ichorpowered/protocolcontrol.git"
url = "https://github.com/ichorpowered/protocolcontrol/"
}
}
}
}
}