-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle
More file actions
148 lines (122 loc) · 3.53 KB
/
Copy pathbuild.gradle
File metadata and controls
148 lines (122 loc) · 3.53 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
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
/////////////////////////////
// BuildScript and Plugins //
/////////////////////////////
plugins {
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '0.7.+'
id 'org.jetbrains.kotlin.jvm' version "${kotlin_version}"
id 'org.jetbrains.kotlin.plugin.serialization' version "${kotlin_version}"
id 'org.jetbrains.dokka' version "1.9.10"
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
compileKotlin {
kotlinOptions.jvmTarget = "17"
}
version = "${minecraft_version}-${mod_version}"
//////////////////
// Dependencies //
//////////////////
repositories {
mavenCentral()
maven {
name 'Kotlin for Forge'
url 'https://thedarkcolour.github.io/KotlinForForge/'
content { includeGroup "thedarkcolour" }
}
}
configurations {
shade
implementation.extendsFrom shade
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
implementation "thedarkcolour:kotlinforforge:${kotlinforforge_version}"
shade "com.googlecode.soundlibs:jlayer:1.0.1.4"
}
minecraft {
mappings channel: mappings_channel, version: mappings_version
runs {
configureEach {
lazyToken('minecraft_classpath') {
configurations.shade
.copyRecursive()
.resolve()
.collect { it.absolutePath }
.join(File.pathSeparator)
}
}
client {
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'betterrecords'
workingDirectory project.file('run')
mods {
betterrecords {
source sourceSets.main
}
}
}
server {
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'betterrecords'
workingDirectory project.file('run')
mods {
betterrecords {
source sourceSets.main
}
}
}
}
}
mixin {
add(sourceSets.main, "mixins.betterrecords.refmap.json")
config("mixins.betterrecords.json")
}
///////////////
// Artifacts //
//////////////
def replacedProperties = [
version: version,
loader_range: loader_range,
forge_range: forge_range,
minecraft_range: minecraft_range,
]
processResources {
inputs.properties(replacedProperties)
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand(replacedProperties)
}
}
shadowJar {
archiveClassifier = ''
configurations = [project.configurations.shade]
relocate 'javazoom', 'com.hemogoblins.betterrecords.shadow.javazoom'
finalizedBy 'reobfShadowJar'
}
reobf {
shadowJar {}
}
tasks.named('jar') {
archiveClassifier = 'slim'
}
assemble.dependsOn shadowJar
task deobfJar(type: Jar) {
from sourceSets.main.output
archiveClassifier = 'deobf'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
archiveClassifier = 'javadoc'
}
artifacts {
archives deobfJar
archives sourcesJar
archives javadocJar
}