-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.gradle
More file actions
112 lines (93 loc) · 2.67 KB
/
build.gradle
File metadata and controls
112 lines (93 loc) · 2.67 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
plugins {
// loom plugin
id "fabric-loom" version "${loom_version}"
id "ploceus" version "${loom_version}"
id "com.palantir.git-version" version "4.2.0"
id "com.diffplug.spotless" version "8.1.0"
}
// set basic properties
def hash = ""
if(project.release=="false") {
hash = "-SNAPSHOT_"+versionDetails().gitHash.substring(0,7)
}
version = project.version+hash
group = project.group
base {
archivesName = project.artifact
}
java {
// compile for java 8
sourceCompatibility = targetCompatibility = 8
}
loom {
// set access widener
accessWidenerPath = file("src/main/resources/tasmod.accesswidener")
// add log4jconfig
log4jConfigs.from(file("src/main/resources/log4j.xml"))
}
// dependency repositories
repositories {
mavenCentral()
maven { url = "https://maven.minecrafttas.com/main" }
maven { url = "https://maven.legacyfabric.net/" }
//maven { url = "https://maven.minecrafttas.com/snapshots" }
maven { url = "https://jitpack.io" }
maven { url = "https://repo.spongepowered.org/maven" }
}
// dependency configurations
configurations {
// embed dependency included in build
implementation.extendsFrom(embed)
}
ploceus {
setIntermediaryGeneration(2)
}
// dependencies
dependencies {
// tasmod dependencies
embed "com.dselent:bigarraylist:1.6"
embed "com.github.KaptainWutax:SeedUtils:b6a383113c"
// loom dependencies
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings ploceus.mcpMappings(project.mcp_channel, project.mcp_mcversion, project.mcp_build)
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// testing dependencies
testImplementation "org.junit.jupiter:junit-jupiter:5.14.1"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
}
compileJava {
options.release = 8
}
// process fabric mod json
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft_version
filesMatching("fabric.mod.json") {
expand "mod_url": project.mod_url, "name": project.mod_name, "mod_version": project.version, "mod_description": project.mod_description, "mod_sources": project.mod_sources, "mod_email": project.mod_email
}
}
// configure jar file
jar {
// pack embedded stuff
from {
configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "LICENSE.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF"
}
}
// configure testing
tasks.named("test", Test) {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
spotless {
encoding "UTF-8"
lineEndings "UNIX"
java {
importOrderFile("formatter/TASmodImportorder.txt")
eclipse().configFile("formatter/TASmodFormatter.xml")
}
enforceCheck false
}