-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
110 lines (89 loc) · 3.22 KB
/
build.gradle
File metadata and controls
110 lines (89 loc) · 3.22 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
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${forge_gradle_version}", changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: "${mixin_gradle_version}"
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'org.spongepowered.mixin'
version = "${mc_version}-${mod_version}-${mod_stage}"
group = "meldexun.${mod_id}"
archivesBaseName = "${mod_name}"
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
minecraft {
mappings channel: "${mappings_channel}", version: "${mappings_version}"
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
taskName "runClient ${mod_name} ${mc_version}"
environment 'MC_VERSION', "${mc_version}"
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'info'
property 'fml.coreMods.load', "${mod_plugin_class}"
}
server {
taskName "runServer ${mod_name} ${mc_version}"
environment 'MC_VERSION', "${mc_version}"
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'info'
property 'fml.coreMods.load', "${mod_plugin_class}"
}
}
}
configurations {
includedDependencies
implementation.extendsFrom(includedDependencies)
buildDependencies
}
repositories {
ivy {
url 'https://github.com/'
patternLayout {
artifact '[organisation]/[module]/releases/download/v[revision]/[module]-[revision].[ext]'
}
metadataSources { artifact() }
}
maven { url = 'https://www.cursemaven.com' }
}
dependencies {
minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"
implementation "org.spongepowered:mixin:${mixin_version}"
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
}
mixin {
add sourceSets.main, "mixins.${mod_id}.refmap.json"
config "mixins.${mod_id}.json"
}
processResources {
inputs.property('version', "${mod_stage}" != "" ? "${mod_version}-${mod_stage}" : "${mod_version}")
filesMatching('mcmod.info') {
expand version: inputs.properties.get('version')
}
}
jar {
archiveBaseName = mod_name
archiveAppendix = mc_version
archiveVersion = mod_version
archiveClassifier = mod_stage
from {
configurations.includedDependencies.collect { it.isDirectory() ? it : zipTree(it) }
}
manifest {
// attributes 'FMLAT': 'accesstransformer.cfg'
attributes 'FMLCorePlugin': "${mod_plugin_class}"
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'ForceLoadAsMod': 'true'
attributes 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker'
attributes 'TweakOrder': '0'
attributes 'MixinConfigs': "mixins.${mod_id}.json"
}
}
jar.finalizedBy('reobfJar')
compileJava {
classpath = sourceSets.main.compileClasspath + configurations.buildDependencies
}