-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
171 lines (148 loc) · 5.59 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
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
maven { url = 'https://maven.parchmentmc.org' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${forgegradle_version}", changing: true
classpath "org.spongepowered:mixingradle:${mixingradle_version}"
classpath group: 'org.parchmentmc.librarian.forgegradle', name: 'org.parchmentmc.librarian.forgegradle.gradle.plugin', version: '1.+'
}
}
apply plugin: 'java'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
archivesBaseName = "${mod_name} ${minecraft_version}"
mixin {
add sourceSets.main, "${mod_id}.refmap.json"
config "${mod_id}.mixins.json"
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: 'parchment', version: '2023.09.03-1.20.1'
//mappings channel: 'official', version: minecraft_version
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
taskName 'Client'
}
server {
taskName 'Server'
}
data {
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/'), "--existing-mod", "blueprint"
taskName 'Data'
}
forEach {
it.workingDirectory project.file('run')
it.ideaModule "${rootProject.name}.main"
it.args "-mixin.config=${mod_id}.mixins.json"
it.mods {
create(mod_id) {
source sourceSets.main
}
}
}
}
}
sourceSets.main.resources.srcDir 'src/generated/resources'
repositories {
maven {
// location of the maven that hosts Blueprint
name = "Jackson's Maven"
url = "https://maven.jaackson.me"
}
maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
maven {
name = "Curse Maven"
url = "https://www.cursemaven.com"
content {
includeGroup("curse.maven")
}
}
maven {
url = "https://api.modrinth.com/maven"
content {
includeGroup("maven.modrinth")
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
implementation fg.deobf("com.teamabnormals:blueprint:${minecraft_version}-${blueprint_version}")
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1"))
implementation(jarJar("io.github.llamalad7:mixinextras-forge:${mixin_extras_version}")) {
jarJar.ranged(it, "[${mixin_extras_version},)")
}
// Compatibilities
implementation(fg.deobf("maven.modrinth:supplementaries:${supplementaries_version}"))
implementation(fg.deobf("maven.modrinth:amendments:${amendments_version}"))
implementation(fg.deobf("maven.modrinth:moonlight:${moonlight_lib_version}"))
// For dev testing
runtimeOnly(fg.deobf("maven.modrinth:oreganized:${oreganized_version}"))
runtimeOnly(fg.deobf("maven.modrinth:dye-depot:${dye_depot_version}"))
/// Utilities for the development environment
//runtimeOnly fg.deobf("curse.maven:jade-324717:${jade_version}")
// compile against the JEI API but do not include it at runtime
compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}"))
compileOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}"))
// at runtime, use the full JEI jar for Forge
runtimeOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}"))
}
jar {
archiveClassifier.set("raw")
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_author,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestamp' : System.currentTimeMillis(),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Build-On-Minecraft' : minecraft_version
])
}
}
tasks.jarJar {
archiveClassifier.set("")
}
jar.finalizedBy('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
artifact jar
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}
// Disables Gradle's custom module metadata from being published to maven. The
// metadata includes mapped dependencies which are not reasonably consumable by
// other mod developers.
tasks.withType(GenerateModuleMetadata) {
enabled = false
}