-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
135 lines (114 loc) · 3.11 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
plugins {
id 'org.quiltmc.loom' version '1.2.+'
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.+'
id 'org.quiltmc.gradle.licenser' version '2.0.+'
}
group = project.maven_group
version = "${project.mod_version}+${getMCVersionString()}"
archivesBaseName = project.archives_base_name
Set<String> qslModules = [
'core:qsl_base',
'core:crash_info',
'core:lifecycle_events',
'core:resource_loader',
'gui:tooltip',
'entity:entity_events'
]
Set<String> modules = [
'fabric-api-base',
'fabric-lifecycle-events-v1',
'fabric-key-binding-api-v1',
'fabric-rendering-v1',
'fabric-resource-loader-v0'
]
// This field defines the Java version your mod target.
def targetJavaVersion = 17
String getMCVersionString() {
return project.minecraft_version
}
repositories {
maven {
name 'Gegy'
url 'https://maven.gegy.dev'
}
maven {
name 'Jitpack'
url 'https://jitpack.io'
}
mavenCentral()
}
configurations {
shadow
api.extendsFrom shadow
}
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "org.quiltmc:quilt-mappings:${minecraft_version}+build.${quilt_mappings}:intermediary-v2"
modImplementation "org.quiltmc:quilt-loader:${project.loader_version}"
qslModules.stream().map { "org.quiltmc.qsl.${it}:${project.qsl_version}+${minecraft_version}" }.forEach {
modImplementation it
include it
}
modules.stream().map { "org.quiltmc.quilted-fabric-api:${it}:${project.fabric_api_version}-${minecraft_version}" }.forEach {
modImplementation it
include it
}
include(modImplementation("dev.lambdaurora:spruceui:${project.spruceui_version}") {
exclude group: 'net.fabricmc'
exclude group: 'net.fabricmc.fabric-api'
})
include(modImplementation("io.github.queerbric:pridelib:${project.pridelib_version}") {
exclude group: 'net.fabricmc'
exclude group: 'net.fabricmc.fabric-api'
})
shadow 'com.electronwill.night-config:core:3.6.6'
shadow "com.electronwill.night-config:toml:3.6.6"
}
java {
sourceCompatibility = JavaVersion.toVersion(targetJavaVersion)
targetCompatibility = JavaVersion.toVersion(targetJavaVersion)
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release.set(targetJavaVersion)
}
processResources {
inputs.property 'version', project.version
filesMatching('quilt.mod.json') {
expand 'version': project.version
}
}
jar {
from('LICENSE') {
rename { "${it}_${project.archivesBaseName}" }
}
}
license {
rule file('codeformat/HEADER')
include '**/*.java'
}
shadowJar {
dependsOn jar
configurations = [project.configurations.shadow]
destinationDirectory.set(file("${project.buildDir}/devlibs"))
archiveClassifier.set('dev')
relocate 'com.electronwill.nightconfig', 'dev.lambdaurora.lambdamap.shadow.nightconfig'
}
remapJar.dependsOn(shadowJar)
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}