-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
104 lines (82 loc) · 2.74 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
plugins {
id "maven-publish"
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply(false)
id "com.github.johnrengelman.shadow" version "7.0.0" apply(false)
}
architectury {
minecraft = rootProject.minecraft_version
}
def isCI = System.getenv("GITHUB_ACTION")
def isRELEASE = System.getenv("GITHUB_RELEASE")
def gitHash() {
String hash = System.getenv("GITHUB_SHA")
if (hash != null) return hash.substring(0,8)
return ""
}
subprojects {
apply plugin: "dev.architectury.loom"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
loom {
silentMojangMappingsLicense()
}
dependencies {
minecraft("com.mojang:minecraft:${rootProject.minecraft_version}")
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.mappings_version}@zip")
}
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.17.1+build.32:v2"
}
}
allprojects {
apply plugin: "maven-publish"
apply plugin: "java"
apply plugin: "architectury-plugin"
group = rootProject.maven_group
apply from: 'https://raw.githubusercontent.com/GregTech-Intergalactical/GradleSripts/main/repositories.gradle'
java {
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
}
if (isCI) {
version = version + "-" + gitHash()
}
}
subprojects{
if (!project.path.contains("common")){
apply plugin: "com.github.johnrengelman.shadow"
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
if (project.path.contains("forge")){
developmentForge.extendsFrom common
} else{
developmentFabric.extendsFrom common
}
}
shadowJar {
configurations = [project.configurations.shadowCommon]
archiveClassifier.set "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier.set null
}
jar {
archiveClassifier.set "dev"
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
}
}