-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
171 lines (144 loc) · 5.68 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
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
plugins {
id "idea"
id "java"
id ("architectury-plugin") version "3.4-SNAPSHOT"
id ("dev.architectury.loom") version "1.0-SNAPSHOT"
//id 'org.jetbrains.kotlin.jvm' version '1.6.20'
id ("com.github.johnrengelman.shadow") version "7.1.2" apply false
id "maven-publish"
id 'io.github.juuxel.loom-vineflower' version '1.11.0' apply false // add vineflower, see https://github.com/Juuxel/loom-vineflower
}
//apply from : 'https://featurehouse.github.io/resources/18/06/953b4d/e2d196c3f97701c23ca7d34ce2ed2576a86fab019e7a2009b2b94d/kff-3.3.2.gradle'
class Constant {
static final LocalDateTime now = LocalDateTime.now(ZoneId.of('+8'))
static final String timestamp = "${DateTimeFormatter.ofPattern("yyMMdd.HHmm").format(now)}"
}
architectury {
minecraft = rootProject.minecraft_version
common("forge", "fabric")
}
loom {
accessWidenerPath = file("src/main/resources/xdi8.accesswidener")
}
dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury:${rootProject.architectury_version}"
}
allprojects {
//if (project.name.endsWith("fake")) return;
apply plugin: "dev.architectury.loom"
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "io.github.juuxel.loom-vineflower"
apply plugin: "maven-publish"
version = "1.18.2-2.0.0+build.${Constant.timestamp}"
group = "top.xdi8.mod"
archivesBaseName = "Xdi8aho-Mod"
loom {
silentMojangMappingsLicense()
}
dependencies {
repositories {
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://maven.parchmentmc.org/" }
}
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
modImplementation 'com.google.errorprone:error_prone_annotations:2.18.0'
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.layered {
officialMojangMappings()
// Can we use yarn parameters?
//it.mappings("net.fabricmc:yarn:${rootProject.yarn_version}:v2")
it.parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}")
}
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.18.2+build.4:v2"
}
java.withSourcesJar()
processResources {
inputs.property version, project.version
filesMatching(["META-INF/mods.toml", "fabric.mod.json"]) {
expand 'version': project.version
}
}
jar {
manifest {
attributes([
"Specification-Title" : "Firefly8",
"Specification-Vendor" : "Xdi8Aho Mods",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.version,
"Implementation-Vendor" : "QWERTY770,teddyxlandlee",
"Implementation-Timestamp": "${Constant.now}"
])
}
from("NOTICE.txt") {
rename { "META-INF/NOTICE_xdi8.txt" }
}
from('LICENSE.txt') {
rename { "META-INF/LICENSE_xdi8.txt" }
}
}
sourcesJar {
duplicatesStrategy = 'EXCLUDE'
}
tasks.withType(JavaCompile.class).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
options.release = 17
}
}
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
repositories {
mavenCentral()
}
// Include resources generated by data generators.
//sourceSets.main.resources { srcDir 'src/generated/resources' }
subprojects {
//if (project.name.endsWith("fake")) return;
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "io.github.juuxel.loom-vineflower" // add vineflower
architectury {
platformSetupLoomIde()
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
}
loom {
accessWidenerPath = project(":").loom.accessWidenerPath
}
shadowJar {
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier null
}
jar {
classifier "dev"
}
sourcesJar {
def commonSources = project(":").sourcesJar
duplicatesStrategy = 'EXCLUDE'
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
}