-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
137 lines (116 loc) · 4.22 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
134
135
136
137
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net/' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:4.+'
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.9.23'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.23'
// id 'org.jlleitschuh.gradle.ktlint' version '11.5.1'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '1.0-SNAPSHOT'
group = 'com.firestartermc.charcoal'
archivesBaseName = 'charcoal'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft {
mappings channel: 'snapshot', version: '20171003-1.12'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
arg '-torg.spongepowered.asm.launch.MixinTweaker'
}
server {
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
arg '-torg.spongepowered.asm.launch.MixinTweaker'
}
}
}
configurations {
shade
implementation.extendsFrom shade
}
dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
compileOnly('org.spongepowered:mixin:0.8.5') {
exclude module: 'guava'
exclude module: 'commons-io'
exclude module: 'gson'
}
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.3.5")
// kotlin
shade 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.23'
shade 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0'
shade 'org.jetbrains.kotlinx:kotlinx-datetime:0.6.0-RC.2'
// http
shade 'io.ktor:ktor-client-core:2.3.10'
shade 'io.ktor:ktor-client-cio:2.3.10'
shade 'io.ktor:ktor-client-content-negotiation:2.3.10'
shade 'io.ktor:ktor-serialization-kotlinx-json:2.3.10'
}
mixin {
add sourceSets.main, 'refmap.charcoal.json'
config 'mixins.charcoal.json'
}
shadowJar {
archiveClassifier = ''
configurations = [project.configurations.shade]
finalizedBy 'reobfShadowJar'
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
archiveClassifier = 'slim'
manifest {
attributes([
"Specification-Title": "charcoal",
"Specification-Vendor": "firestarter",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"firestarter",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"FMLCorePluginContainsFMLMod": "true",
"ForceLoadAsMod": "true",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"TweakOrder": "0"
])
}
}
assemble.dependsOn shadowJar
jar.finalizedBy('reobfJar')
reobf {
shadowJar {}
}
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}