-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
64 lines (54 loc) · 1.62 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
plugins {
id 'java'
}
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
repositories {
maven {
url "https://maven.fabricmc.net/"
}
maven {
url "https://jitpack.io"
}
mavenCentral()
}
dependencies {
// Depend on Deimos. This also brings in Fabric Loader and Mixin
implementation 'com.github.illogicWorks:deimos:0.1'
// Add Mars
implementation files('Mars.jar')
// Add below any extra dependencies you need, though make sure you somehow add
// them to your jar later! Deimos supports Jar-in-jar (given it uses Fabric Loader), but
// there's no Gradle tooling to easily JiJ jars here
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
// Deimos needs Java 11. Though feel free to bump it (do it also at the top for better editor support)
it.options.release = 11
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
// Ideally you should use the launch config
task Run(type: JavaExec) {
// Use runtime classpath
classpath sourceSets.main.runtimeClasspath
// Set main class to Knot
mainClass = "net.fabricmc.loader.impl.launch.knot.KnotClient"
// Mark as development environment
systemProperty "fabric.development", "true"
// Set working directory
File runDir = new File(projectDir, 'run/')
runDir.mkdir() // (create if needed)
workingDir = runDir
}