-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathbuild.gradle
159 lines (126 loc) · 4.08 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
plugins {
id 'java-library'
id 'maven-publish'
id 'checkstyle'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
version = System.getenv('GITHUB_VERSION') ?: 'local'
group = 'com.onarandombox.multiverseinventories'
description = 'Multiverse-Inventories'
java.sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'onarandombox'
url = uri('https://repo.onarandombox.com/content/groups/public')
}
maven {
name ='papermc'
url = uri('https://papermc.io/repo/repository/maven-public/')
}
maven {
name = 'jitpack.io'
url = uri('https://jitpack.io/')
}
}
dependencies {
// Spigot
implementation('org.bukkit:bukkit:1.14.4-R0.1-SNAPSHOT') {
exclude group: 'junit', module: 'junit'
}
// Core
implementation('com.onarandombox.multiversecore:Multiverse-Core:4.2.2') {
exclude group: 'me.main__.util', module: 'SerializationConfig'
}
// Config
api 'com.dumptruckman.minecraft:JsonConfiguration:1.1'
api ('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'junit', module: 'junit'
}
// Utils
api 'io.papermc:paperlib:1.0.7'
api('com.dumptruckman.minecraft:Logging:1.1.1') {
exclude group: 'junit', module: 'junit'
}
// Other plugins for import
implementation('uk.co:MultiInv:3.0.6') {
exclude group: '*', module: '*'
}
implementation('me.drayshak:WorldInventories:1.0.2') {
exclude group: '*', module: '*'
}
// Legacy Multiverse-Adventure
implementation('com.onarandombox.multiverseadventure:Multiverse-Adventure:2.5.0-SNAPSHOT') {
exclude group: '*', module: '*'
}
// Tests
testImplementation 'com.github.MilkBowl:VaultAPI:1.7.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.11.2'
}
java {
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc).configureEach {
options.encoding = 'UTF-8'
}
configurations {
[apiElements, runtimeElements].each {
it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) }
it.outgoing.artifact(shadowJar)
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/Multiverse/Multiverse-Inventories"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
processResources {
def props = [version: "${project.version}"]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
// This task should never be skipped. The tests depend on this having been run but we want the new version number
// that is created after tests are run and before we run again to publish.
outputs.upToDateWhen { false }
}
checkstyle {
toolVersion = '6.1.1'
configFile file('config/mv_checks.xml')
ignoreFailures = true
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
}
project.configurations.api.canBeResolved = true
shadowJar {
relocate 'com.dumptruckman.minecraft.util.Logging', 'com.onarandombox.multiverseinventories.utils.InvLogging'
relocate 'com.dumptruckman.minecraft.util.DebugLog', 'com.onarandombox.multiverseinventories.utils.DebugFileLogger'
relocate 'com.dumptruckman.bukkit.configuration', 'com.onarandombox.multiverseinventories.utils.configuration'
relocate 'io.papermc.lib', 'com.onarandombox.multiverseinventories.utils.paperlib'
relocate 'net.minidev.json', 'com.onarandombox.multiverseinventories.utils.json'
configurations = [project.configurations.api]
archiveFileName = "$baseName-$version.$extension"
}
build.dependsOn shadowJar
jar.enabled = false