-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathbuild.gradle
More file actions
221 lines (192 loc) · 7.33 KB
/
build.gradle
File metadata and controls
221 lines (192 loc) · 7.33 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
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven { url 'https://jitpack.io' }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath("com.gradleup.shadow:com.gradleup.shadow.gradle.plugin:9.3.0")
}
}
plugins {
id 'net.fabricmc.fabric-loom' version '1.15-SNAPSHOT'
id 'com.gradleup.shadow' version "9.3.0"
id 'maven-publish'
}
version = project.mod_version
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
maven {
url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1"
content {
includeGroup("me.djtheredstoner")
}
}
maven {
url 'https://api.modrinth.com/maven'
content {
includeGroup("maven.modrinth")
}
}
maven {
url = "https://maven.bawnorton.com/releases"
content {
includeGroup("com.github.bawnorton.mixinsquared")
}
}
mavenLocal()
}
loom {
accessWidenerPath = file("src/main/resources/flashback.accesswidener")
}
dependencies {
// Minecraft and fabric
minecraft "com.mojang:minecraft:${project.minecraft_version}"
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Login in dev environment
runtimeOnly("me.djtheredstoner:DevAuth-fabric:1.1.2")
// MixinConstraints
include(implementation("com.moulberry:mixinconstraints:1.0.8"))
// MixinSquared
include(implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:0.3.7-beta.1")))
// Lattice (config)
include(implementation("com.moulberry:lattice:2.0.1+26.1"))
// Apache stuff
include(implementation("org.apache.commons:commons-math3:3.6.1"))
include(implementation("org.apache.httpcomponents:httpclient:4.5.14"))
include(implementation("org.apache.httpcomponents:httpcore:4.4.16"))
// Mod compatibility
compileOnly("maven.modrinth:distanthorizons:Mt9bDAs6")
compileOnly("maven.modrinth:sodium:Amr4VcZo")
compileOnly("maven.modrinth:iris:MwcLS51S")
compileOnly("maven.modrinth:bobby:8gsFUovP")
compileOnly("maven.modrinth:simple-voice-chat:mXHTeWn9")
compileOnly("maven.modrinth:modmenu:jvjwXH6l")
compileOnly("maven.modrinth:scalablelux:gYbHVCz8")
// FFmpeg
shadow(implementation("org.bytedeco:javacv-platform:1.5.10") {
exclude group: "org.bytedeco", module: "artoolkitplus"
exclude group: "org.bytedeco", module: "artoolkitplus-platform"
exclude group: "org.bytedeco", module: "flycapture"
exclude group: "org.bytedeco", module: "flycapture-platform"
exclude group: "org.bytedeco", module: "leptonica"
exclude group: "org.bytedeco", module: "leptonica-platform"
exclude group: "org.bytedeco", module: "libdc1394"
exclude group: "org.bytedeco", module: "libdc1394-platform"
exclude group: "org.bytedeco", module: "libfreenect"
exclude group: "org.bytedeco", module: "libfreenect-platform"
exclude group: "org.bytedeco", module: "libfreenect2"
exclude group: "org.bytedeco", module: "libfreenect2-platform"
exclude group: "org.bytedeco", module: "librealsense2"
exclude group: "org.bytedeco", module: "librealsense2-platform"
exclude group: "org.bytedeco", module: "librealsense"
exclude group: "org.bytedeco", module: "librealsense-platform"
exclude group: "org.bytedeco", module: "openblas"
exclude group: "org.bytedeco", module: "openblas-platform"
exclude group: "org.bytedeco", module: "opencv"
exclude group: "org.bytedeco", module: "opencv-platform"
exclude group: "org.bytedeco", module: "tesseract"
exclude group: "org.bytedeco", module: "tesseract-platform"
exclude group: "org.bytedeco", module: "videoinput"
exclude group: "org.bytedeco", module: "videoinput-platform"
})
// ImGui
shadow(implementation(rootProject.files('deps/imgui-binding-1.90.0.jar')))
shadow(api(rootProject.files('deps/imgui-natives.jar')))
// Native File Dialogs
String nfdVersion = "org.lwjgl:lwjgl-nfd:3.3.3";
shadow(implementation(nfdVersion) {
exclude group: 'org.lwjgl'
exclude group: 'org.lwjgl.lwjgl'
})
shadow(api("org.lwjgl:lwjgl-nfd::natives-macos") {
exclude group: 'org.lwjgl'
exclude group: 'org.lwjgl.lwjgl'
})
shadow(api("org.lwjgl:lwjgl-nfd::natives-linux") {
exclude group: 'org.lwjgl'
exclude group: 'org.lwjgl.lwjgl'
})
shadow(api("org.lwjgl:lwjgl-nfd::natives-windows") {
exclude group: 'org.lwjgl'
exclude group: 'org.lwjgl.lwjgl'
})
shadow(api("org.lwjgl:lwjgl-nfd::natives-macos-arm64") {
exclude group: 'org.lwjgl'
exclude group: 'org.lwjgl.lwjgl'
})
shadow(api("org.lwjgl:lwjgl-nfd::natives-linux-arm64") {
exclude group: 'org.lwjgl'
exclude group: 'org.lwjgl.lwjgl'
})
shadow(api("org.lwjgl:lwjgl-nfd::natives-windows-arm64") {
exclude group: 'org.lwjgl'
exclude group: 'org.lwjgl.lwjgl'
})
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 25
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
}
}
shadowJar {
configurations = [project.configurations.shadow]
archiveBaseName = "flashback"
destinationDirectory = file("${buildDir}/tmp/allJar")
exclude("LICENSE")
exclude("LICENSE.txt")
}
// Super hacky... merge the shadowJar with the main jar.
// This is needed because the main jar has the includes
// Couldn't find a better way of doing this
tasks.register("mergeShadowWithIncludes", Jar) {
archiveBaseName.set("merged")
from(zipTree(project.tasks.jar.archiveFile))
from(zipTree(project.tasks.shadowJar.archiveFile))
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
var archiveFileFrom = it.archiveFile
var archiveFileTo = project.tasks.jar.archiveFile
doLast {
archiveFileFrom.get().asFile.renameTo(archiveFileTo.get().asFile)
}
}
project.assemble.dependsOn(mergeShadowWithIncludes)
// configure the maven publication
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}