forked from CrystalSuki/YesSteveModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
116 lines (98 loc) · 3.42 KB
/
build.gradle
File metadata and controls
116 lines (98 loc) · 3.42 KB
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
import proguard.gradle.ProGuardTask
buildscript {
repositories {
maven { url = "https://plugins.gradle.org/m2/" }
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://maven.parchmentmc.org' }
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'org.gradle.toolchains:foojay-resolver:0.5.0'
//classpath 'org.parchmentmc:librarian:1.+'
classpath 'com.guardsquare:proguard-gradle:7.3.1'
}
}
plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
// id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}
version = '1.1.6'
group = 'com.elfmcys.yesstevemodel'
archivesBaseName = 'yesstevemodel-1.20-release'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: 'official', version: '1.20'
// mappings channel: 'parchment', version: '2023.03.12-1.19.3'
copyIdeResources = true
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run/client_a')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'examplemod'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
examplemod {
source sourceSets.main
}
}
}
client2 {
parent minecraft.runs.client
workingDirectory project.file('run/client_b')
args '--username', 'tartaric_acid'
mods {
yesstevemodel {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run/server')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'examplemod'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
examplemod {
source sourceSets.main
}
}
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
flatDir {
dir 'libs'
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.20-46.0.14'
implementation fg.deobf('libs:firstperson-forge:2.2.3-mc1.20')
implementation fg.deobf('libs:notenoughanimations-forge:1.6.4-mc1.20')
}
jar {
manifest {
attributes([
"Implementation-Title" : project.name,
"Implementation-Version": "${version}"
])
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
// 运行此 task 编译并混淆模组
task proguard(type: ProGuardTask, dependsOn: build) {
configuration file('proguard.pro')
injars(tasks.named('jar', Jar).flatMap { it.archiveFile })
outjars(file("${buildDir}/libs/${archivesBaseName}-${version}-minified.jar"))
}