-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
133 lines (112 loc) · 4.04 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
buildscript {
repositories {
maven { url = "https://maven.aliyun.com/repository/public" }
mavenCentral()
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+'
classpath 'org.spongepowered:mixingradle:0.7.+'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20"
}
}
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'kotlin'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
version = '1.0'
group = 'top.kmar.mi'
archivesBaseName = 'mi'
/** 是否为调试 */
ext.debug = true
minecraft {
mappings channel: 'snapshot', version: '20171003-1.12'
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'mi'
}
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'mi'
}
}
}
repositories {
maven { url = "https://maven.aliyun.com/repository/public" }
mavenCentral()
// Put repositories for dependencies here
// ForgeGradle automatically adds the Forge maven and Maven Central for you
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
// flatDir {
// dir 'libs'
// }
}
dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2859'
implementation 'org.spongepowered:mixin:0.8.5'
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
mixin {
// MixinGradle Settings
add sourceSets.main, 'mixins.mi.refmap.json'
config 'mixins.mi.json'
}
// Example for how to get properties into the manifest for reading at runtime.
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest.attributes([
"TweakClass" : "top.kmar.mi.coremod.boot.MIMixinTweaker",
"FMLCorePluginContainsFMLMod": true
])
from {
configurations.runtimeClasspath.findAll {
it.name.contains("mixin") || it.name.contains("kotlin")
}.collect {
zipTree(it)
}
} {
exclude '**/module-info.class',
'LICENSE.txt',
'META-INF/MUMFREY.RSA',
'**/*.kotlin_module'
}
}
compileJava {
options.encoding 'UTF-8'
}
kotlin {
jvmToolchain(8)
sourceSets.configureEach {
languageSettings {
languageVersion = "2.0"
}
}
}
compileKotlin.compilerOptions {
freeCompilerArgs.addAll(
"-Xjvm-default=all", // 接口 default 方法
"-Xlambdas=indy" // indy
)
if (!debug) freeCompilerArgs.addAll(
"-Xassertions=always-disable", // 禁用断言
"-Xsam-conversions=indy",
"-Xvalidate-bytecode" // 优化
)
}