-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
190 lines (160 loc) · 4.73 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
buildscript {
repositories {
maven { url 'https://maven.minecraftforge.net' }
maven { url 'https://repo.spongepowered.org/repository/maven-public' }
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6.0.+', changing: true
classpath 'org.spongepowered:mixingradle:0.7.+'
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
def coreMixin = 'mixins.liteloader.core.json'
def coreRefMap = 'mixins.liteloader.core.refmap.json'
def clientMixin = 'mixins.liteloader.client.json'
def clientRefMap = 'mixins.liteloader.client.refmap.json'
configurations {
embed
implementation.extendsFrom(embed)
clientAnnotationProcessor
}
minecraft {
mappings channel: 'stable', version: '39-1.12'
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
args += ['--tweakClass', 'org.spongepowered.asm.launch.MixinTweaker',
'--mixin', coreMixin,
'--mixin', clientMixin]
mods {
sanctum {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
args += ['--tweakClass', 'org.spongepowered.asm.launch.MixinTweaker',
'--mixin', coreMixin,
'nogui']
mods {
sanctum {
source sourceSets.main
}
}
}
}
}
ext {
def isJenkins = project.hasProperty('jenkins')
buildVersion = project.hasProperty('buildVersion') ? buildVersion : '0.0'
isReleaseBuild = true
brand = isJenkins ? "${project.mcVersion}-SNAPSHOT-r${System.env.GIT_COMMIT.take(7).toUpperCase()}-b${System.env.BUILD_NUMBER}-${System.env.BUILD_ID}" : ''
projectName = 'LiteLoader'
inceptionYear = '2012'
packaging = 'jar'
startClass = 'com.mumfrey.liteloader.debug.Start'
tweakClass = 'com.mumfrey.liteloader.launch.LiteLoaderTweaker'
}
group = 'com.mumfrey'
archivesBaseName = 'liteloader'
version = buildVersion
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
url "https://maven.outlands.top/releases/"
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
compileOnly fileTree(include: ['*.jar'], dir: 'lib')
implementation 'top.outlands:foundation:0.13.11'
implementation 'org.spongepowered:mixin:0.8.7'
annotationProcessor 'org.spongepowered:mixin:0.8.7:processor'
clientAnnotationProcessor 'org.spongepowered:mixin:0.8.7:processor'
}
sourceSets {
main {
ext.refMap = coreRefMap
resources.srcDir 'src/generated/resources'
}
client {
compileClasspath += main.compileClasspath + main.output
resources.srcDir 'src/generated/resources'
ext.refMap = clientRefMap
}
debug {
compileClasspath += client.compileClasspath + client.output
}
}
mixin {
add sourceSets.main, coreRefMap
add sourceSets.client, clientRefMap
config coreMixin
config clientMixin
}
compileClientJava {
options.annotationProcessorPath = configurations.clientAnnotationProcessor
}
afterEvaluate {
logger.lifecycle '================================================='
logger.lifecycle ' LiteLoader'
logger.lifecycle ' Copyright (C) 2011-2017 Adam Mummery-Smith'
logger.lifecycle ' Running in {} mode', (project.isReleaseBuild ? 'RELEASE' : 'SNAPSHOT')
logger.lifecycle '================================================='
}
processResources {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
inputs.property 'brand', project.brand
from (sourceSets.main.resources.srcDirs) {
include 'liteloader.properties'
filter { line -> line.startsWith('brand=') ? line + project.brand : line }
}
}
def jarManifest = {
attributes (
'Built-By': System.properties['user.name'],
'Created-By': "${System.properties['java.vm.version']} (${System.properties['java.vm.vendor']})",
'Implementation-Title': name,
'Implementation-Version': version,
'Implementation-Vendor': url,
'TweakClass': tweakClass
)
}
jar {
doFirst {
ant.replace(
file: file("${compileJava.temporaryDir}/${sourceSets.main.refMap}"),
token: "func_72355_a(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;)V",
value: "initializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V"
)
}
from sourceSets.client.output
from sourceSets.debug.output
manifest jarManifest
}
tasks.withType(JavaCompile).configureEach {
options.deprecation = true
options.encoding = 'utf8'
options.release = 21
options.compilerArgs += [
'-Xlint:all',
'-Xlint:-path',
'-Xlint:-rawtypes',
'-Xlint:-processing'
]
}
artifacts {
archives jar
}