-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
198 lines (171 loc) · 7.14 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
import org.apache.tools.ant.filters.*
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java-library'
id 'maven-publish'
id 'net.nemerosa.versioning' version '3.1.0'
id 'architectury-plugin' version '3.4-SNAPSHOT'
id 'dev.architectury.loom' version '1.6-SNAPSHOT' apply false
id 'signing'
}
sourceCompatibility = '17'
targetCompatibility = '17'
if (System.getenv("STABLE_BUILD") == '0') {
rootProject.version = versioning.info.build + "-DEV"
} else {
rootProject.version = "1.0-pre"
}
subprojects {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'signing'
apply plugin: 'base'
repositories {
maven {
name = "PiconoDev Repository"
url "https://repo.piconodev.com/repository/maven-snapshots"
}
}
configurations {
shadow
}
shadowJar {
archiveBaseName.set(rootProject.archives_base_name)
archiveVersion.set(rootProject.version)
configurations = [project.configurations.shadow]
}
tasks.withType(ShadowJar).configureEach {
relocate 'org.spongepowered.configurate', 'com.gmail.picono435.picojobs.libs.org.spongepowered.configurate'
relocate 'com.google.common', 'com.gmail.picono435.picojobs.libs.com.google.common'
relocate 'com.google.errorprone', 'com.gmail.picono435.picojobs.libs.com.google.errorprone'
relocate 'com.google.gson', 'com.gmail.picono435.picojobs.libs.com.google.gson'
relocate 'com.google.j2objc', 'com.gmail.picono435.picojobs.libs.com.google.j2objc'
relocate 'com.google.thirdparty', 'com.gmail.picono435.picojobs.libs.com.google.thirdparty'
relocate 'com.typesafe.config', 'com.gmail.picono435.picojobs.libs.com.typesafe.config'
relocate 'io.github.slimjar', 'com.gmail.picono435.picojobs.libs.io.github.slimjar'
relocate 'io.leangen.geantyref', 'com.gmail.picono435.picojobs.libs.io.github.geantyref'
relocate 'javax.annotation', 'com.gmail.picono435.picojobs.libs.javax.annotation'
relocate 'org.apache.commons', 'com.gmail.picono435.picojobs.libs.org.apache.commons'
relocate 'org.apache.maven.artifact', 'com.gmail.picono435.picojobs.libs.org.apache.maven.artifact'
relocate 'org.apache.maven.repository', 'com.gmail.picono435.picojobs.libs.org.apache.maven.repository'
relocate 'org.checkerframework', 'com.gmail.picono435.picojobs.libs.org.checkerframework'
relocate 'org.codehaus.plexus', 'com.gmail.picono435.picojobs.libs.org.codehaus.plexus'
relocate 'org.yaml.snakeyaml', 'com.gmail.picono435.picojobs.libs.org.yaml.snakeyaml'
}
tasks.withType(JavaExec).configureEach {
systemProperty("bstats.relocatecheck", "false")
}
/*signing {
useGpgCmd()
sign configurations.shadow
}*/
}
allprojects {
apply plugin: 'java-library'
apply plugin: 'signing'
archivesBaseName = rootProject.archives_base_name
version = rootProject.version
group = rootProject.group
description = rootProject.description
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
processResources {
filter ReplaceTokens, tokens: [
"name": rootProject.property("name"),
"version": rootProject.property("version"),
"description": rootProject.property("description")
]
}
}
configure([project(':common-mod'), project(':fabric'), project(':forge')]) {
apply plugin: "architectury-plugin"
apply plugin: "dev.architectury.loom"
base {
archivesName = rootProject.archives_base_name
}
loom {
silentMojangMappingsLicense()
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.officialMojangMappings()
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
java {
withSourcesJar()
}
architectury {
minecraft = rootProject.minecraft_version
}
tasks.withType(ShadowJar).configureEach {
relocate 'com.github.benmanes.caffeine', 'com.gmail.picono435.picojobs.libs.com.github.benmanes.caffeine'
relocate 'com.google.protobuf', 'com.gmail.picono435.picojobs.libs.com.google.protobuf'
relocate 'google.protobuf', 'com.gmail.picono435.picojobs.libs.google.protobuf'
relocate 'com.mongodb', 'com.gmail.picono435.picojobs.libs.com.mongodb'
relocate 'com.mysql', 'com.gmail.picono435.picojobs.libs.com.mysql'
relocate 'com.sun.jna', 'com.gmail.picono435.picojobs.libs.com.sun.jna'
relocate 'com.zaxxer.hikari', 'com.gmail.picono435.picojobs.libs.com.zaxxer.hikari'
relocate 'org.bson', 'com.gmail.picono435.picojobs.libs.org.bson'
relocate 'org.h2', 'com.gmail.picono435.picojobs.libs.org.h2'
relocate 'org.bson', 'com.gmail.picono435.picojobs.libs.org.bson'
relocate 'org.mariadb.jdbc', 'com.gmail.picono435.picojobs.libs.org.mariadb.jdbc'
relocate 'org.bson', 'com.gmail.picono435.picojobs.libs.org.bson'
relocate 'org.sqlite', 'com.gmail.picono435.picojobs.libs.org.sqlite'
relocate 'waffle', 'com.gmail.picono435.picojobs.libs.waffle'
relocate 'org.bstats', 'com.gmail.picono435.picojobs.libs.org.bstats'
dependencies {
exclude(dependency('org.slf4j:slf4j-api'))
exclude(dependency('dev.racci.slimjar:slimjar'))
}
}
}
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = 'picojobs'
version = project.version
from components.java
pom {
name = "PicoJobs"
description = "An amazing plugin that allows you to create your own jobs for your players. The plugin is 100% configurable so you can change everything you see, it is also open-source if you want to take a look on how it's made."
url = "https://github.com/Picono435/PicoJobs"
licenses {
license {
name = "The MIT License"
url = "https://opensource.org/licenses/MIT"
}
}
developers {
developer {
id = "picono435"
name = "Picono435"
email = "[email protected]"
}
}
scm {
connection = "https://github.com/Picono435/PicoJobs"
developerConnection = "https://github.com/Picono435/PicoJobs.git"
url = "https://github.com/Picono435/PicoJobs"
}
}
}
}
repositories {
maven {
credentials {
username System.getenv("REPO_USER")
password System.getenv("REPO_PASSWORD")
}
url = 'https://repo.piconodev.com/repository/maven-releases/'
}
}
}