-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
185 lines (150 loc) · 4.99 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
buildscript {
repositories {
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
mavenCentral()
maven {
name = "Jitpack"
url 'https://jitpack.io/'
}
flatDir {
dirs 'libs'
}
}
dependencies {
classpath 'com.github.calmilamsy:Fabric-Loom:d4e2c31'
}
}
plugins {
id 'java'
id 'maven-publish'
}
compileJava {
options.fork = true
options.forkOptions.executable = 'javac'
options.compilerArgs << "-XDignore.symbol.file" << "-Xlint:unchecked"
}
sourceCompatibility = 1.8
apply plugin: "fabric-loom"
import net.fabricmc.loom.task.RunClientTask
import net.fabricmc.loom.task.RunServerTask
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
idea {
module {
downloadJavadoc = true
}
}
eclipse {
classpath {
downloadJavadoc = true
}
}
repositories {
maven {
name = "Jitpack"
url "https://jitpack.io/"
}
}
minecraft {}
sourceSets {
testmod {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
}
task runTestmodClient(type: RunClientTask) {
classpath sourceSets.testmod.runtimeClasspath
}
task runTestmodServer(type: RunServerTask) {
classpath sourceSets.testmod.runtimeClasspath
}
dependencies {
// fabric loader requires log4j, guava, and gson
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.8.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.1'
annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.8.1'
annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.1'
implementation 'com.google.guava:guava:28.0-jre'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
// mixin and fabric loader need asm 9
implementation 'org.ow2.asm:asm:9.0'
implementation 'org.ow2.asm:asm-analysis:9.0'
implementation 'org.ow2.asm:asm-commons:9.0'
implementation 'org.ow2.asm:asm-tree:9.0'
implementation 'org.ow2.asm:asm-util:9.0'
implementation "com.github.jhalterman:typetools:87240d6"
implementation "com.github.mineLdiver:expressions:2fa66db"
implementation "com.github.mineLdiver:UnsafeEvents:7efec57"
// to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.fromCommit("calmilamsy/BIN-Mappings", "${project.yarn_mappings}") {spec ->
spec.version = "b1.7.3-${project.yarn_mappings}"
}
// convenience stuff
// adds some useful annotations for data classes. does not add any dependencies
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testmodCompileOnly 'org.projectlombok:lombok:1.18.22'
testmodAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
// adds some useful annotations for miscellaneous uses. does not add any dependencies, though people without the lib will be missing some useful context hints.
implementation 'org.jetbrains:annotations:20.1.0'
modImplementation "com.github.minecraft-cursed-legacy:cursed-fabric-loader:${project.loader_version}"
modImplementation "com.github.ModificationStation:StationAPI:${project.stapi_version}"
// For tests only
modImplementation('com.github.calmilamsy:HowManyItems-Fabric-Unofficial:6af40ed') {
exclude group: 'net.modificationstation', module: 'StationAPI'
exclude group: 'com.github.modificationstation'
}
modImplementation "com.github.calmilamsy:ModMenu:dcef643"
implementation group: 'org.javassist', name: 'javassist', version: '3.28.0-GA'
implementation fileTree(dir: 'libs', include: ['*.jar'])
testmodImplementation sourceSets.main.output
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc'
}
tasks.publishToMavenLocal.dependsOn(tasks.remapJar)
publishing {
repositories {
mavenLocal()
}
publications {
mavenJava(MavenPublication) {
artifactId project.archives_base_name
artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar") {
classifier null
builtBy remapJar
}
artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}-dev.jar") {
classifier 'dev'
builtBy remapJar
}
}
}
}