-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
build.gradle
203 lines (180 loc) · 5.01 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
plugins {
id "idea"
id "maven-publish"
id "fabric-loom" version "1.8-SNAPSHOT"
}
base {
group = project.maven_group
archivesName = project.maven_name
version = project.maven_version
description = project.maven_description
}
configurations {
jij // jar in jar configuration
modJij // jar in jar configuration for mods
include.extendsFrom modJij
modImplementation.extendsFrom modJij
modCompileOnlyApi.extendsFrom modJij
}
repositories {
mavenCentral()
maven {
name = "ViaVersion"
url = "https://repo.viaversion.com"
}
maven {
name = "Lenni0451"
url = "https://maven.lenni0451.net/everything"
}
maven {
name = "OpenCollab Snapshots"
url = "https://repo.opencollab.dev/maven-snapshots/"
}
maven {
name = "TerraformersMC"
url = "https://maven.terraformersmc.com/releases"
}
maven {
name = "Jitpack"
url = "https://jitpack.io"
content {
includeGroup "com.github.Oryxel"
}
}
}
loom {
accessWidenerPath = file("src/main/resources/viafabricplus.accesswidener")
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modJij(fabricApi.module("fabric-api-base", project.fabric_api_version))
modJij(fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version))
modJij(fabricApi.module("fabric-networking-api-v1", project.fabric_api_version))
modJij(fabricApi.module("fabric-command-api-v2", project.fabric_api_version))
modJij(fabricApi.module("fabric-lifecycle-events-v1", project.fabric_api_version))
modJij(fabricApi.module("fabric-particles-v1", project.fabric_api_version))
modJij(fabricApi.module("fabric-registry-sync-v0", project.fabric_api_version))
modCompileOnly "com.terraformersmc:modmenu:11.0.3"
jij "com.viaversion:viaversion-common:5.1.2-SNAPSHOT"
jij "com.viaversion:viabackwards-common:5.1.2-SNAPSHOT"
jij "net.raphimc:viaaprilfools-common:3.0.5-SNAPSHOT"
jij "net.raphimc:ViaLegacy:3.0.6-SNAPSHOT"
jij ("net.raphimc:ViaBedrock:0.0.13-SNAPSHOT") {
exclude group: "io.jsonwebtoken"
exclude group: "com.mojang", module: "brigadier"
}
jij ("net.raphimc:ViaLoader:3.0.5-SNAPSHOT") {
exclude group: "com.google.guava", module: "guava"
exclude group: "org.slf4j", module: "slf4j-api"
}
jij ("net.raphimc:MinecraftAuth:4.1.1") {
exclude group: "com.google.code.gson", module: "gson"
exclude group: "org.slf4j", module: "slf4j-api"
}
jij "net.lenni0451:Reflect:1.4.0"
jij("net.lenni0451:MCPing:1.4.2") {
exclude group: "com.google.code.gson", module: "gson"
}
jij("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR3-SNAPSHOT") {
exclude group: "io.netty"
}
jij "de.florianmichael:Classic4J:2.1.1-SNAPSHOT"
// Fabric's jar in jar system doesn't support transitive dependencies, so we have to manually add them
afterEvaluate {
configurations.jij.incoming.resolutionResult.allDependencies.each {
dependencies.include(dependencies.implementation(dependencies.compileOnlyApi(it.requested.toString()) {
transitive = false
}))
}
}
}
processResources {
filesMatching("fabric.mod.json") {
expand(
"version": project.version,
"description": project.description,
"implVersion": "git-${project.name}-${project.version}:${latestCommitHash().get()}",
"mcVersion": mcVersion()
)
}
}
String mcVersion() {
if (project.supported_versions.isEmpty()) {
return project.minecraft_version
} else {
return project.supported_versions
}
}
Provider<String> latestCommitHash() {
return providers.exec {
commandLine = ["git", "rev-parse", "--short", "HEAD"]
}.standardOutput.getAsText().map(String::trim)
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
jar {
// Rename the project's license file to LICENSE_<project_name> to avoid conflicts
from("LICENSE") {
rename {
"${it}_${project.archivesBaseName}"
}
}
}
publishing {
repositories {
maven {
name = "Via"
url = "https://repo.viaversion.com/"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
publications {
maven(MavenPublication) {
groupId = project.maven_group
artifactId = project.maven_name
version = project.maven_version
from components.java
pom {
name = artifactId
description = project.description
url = "https://github.com/ViaVersion/ViaFabricPlus"
licenses {
license {
name = "GPL-3.0 License"
url = "https://github.com/ViaVersion/ViaFabricPlus/blob/main/LICENSE"
}
}
developers {
developer {
id = "FlorianMichael"
name = "EnZaXD"
email = "[email protected]"
}
developer {
id = "RK_01"
}
}
scm {
connection = "scm:git:git://github.com/ViaVersion/ViaFabricPlus.git"
developerConnection = "scm:git:ssh://github.com/ViaVersion/ViaFabricPlus.git"
url = "github.com/ViaVersion/ViaFabricPlus"
}
}
}
}
}
idea {
module {
["run"].each {
excludeDirs << file("$it")
}
}
}