generated from calmilamsy/stationapi-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
141 lines (118 loc) · 4.29 KB
/
build.gradle.kts
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
import org.gradle.internal.extensions.stdlib.toDefaultLowerCase
import java.io.BufferedReader
import java.io.InputStreamReader
import java.net.URI
import java.net.URL
plugins {
id("maven-publish")
id("fabric-loom") version "1.8.10"
id("babric-loom-extension") version "1.8.5"
}
//noinspection GroovyUnusedAssignment
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
base.archivesName = project.properties["archives_base_name"] as String
version = project.properties["mod_version"] as String
group = project.properties["maven_group"] as String
loom {
accessWidenerPath = file("src/main/resources/glassmappinglib.accesswidener")
runs {
// If you want to make a testmod for your mod, right click on src, and create a new folder with the same name as source() below.
// Intellij should give suggestions for testmod folders.
register("testClient") {
source("test")
client()
}
register("testServer") {
source("test")
server()
}
}
}
repositories {
maven("https://maven.glass-launcher.net/snapshots/")
maven("https://maven.glass-launcher.net/releases/")
maven("https://maven.glass-launcher.net/babric")
maven("https://maven.minecraftforge.net/")
maven("https://jitpack.io/")
mavenCentral()
exclusiveContent {
forRepository {
maven("https://api.modrinth.com/maven")
}
filter {
includeGroup("maven.modrinth")
}
}
}
dependencies {
minecraft("com.mojang:minecraft:b1.7.3")
mappings("net.glasslauncher:biny:${project.properties["yarn_mappings"] as String}:v2")
modImplementation("babric:fabric-loader:${project.properties["loader_version"]}")
implementation("org.apache.logging.log4j:log4j-core:2.17.2")
implementation("org.slf4j:slf4j-api:1.8.0-beta4")
implementation("org.apache.logging.log4j:log4j-slf4j18-impl:2.17.1")
// convenience stuff
// adds some useful annotations for data classes. does not add any dependencies
compileOnly("org.projectlombok:lombok:1.18.24")
annotationProcessor("org.projectlombok:lombok:1.18.24")
// 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:23.0.0")
implementation("com.google.guava:guava:33.2.1-jre")
// StAPI itself.
modImplementation("net.modificationstation:StationAPI:${project.properties["stationapi_version"]}")
// Extra mods.
modImplementation("net.glasslauncher.mods:GlassConfigAPI:${project.properties["gcapi_version"]}")
modImplementation("net.glasslauncher.mods:glass-networking:${project.properties["glassnetworking_version"]}")
modImplementation("net.glasslauncher.mods:ModMenu:${project.properties["modmenu_version"]}")
modImplementation("net.glasslauncher.mods:AlwaysMoreItems:${project.properties["alwaysmoreitems_version"]}")
// GML Dependencies
implementation(include("me.carleslc:Simple-Yaml:1.8.4") as Dependency)
}
configurations.all {
exclude(group = "org.ow2.asm", module = "asm-debug-all")
exclude(group = "org.ow2.asm", module = "asm-all")
}
tasks.withType<ProcessResources> {
inputs.property("version", project.properties["version"])
filesMatching("fabric.mod.json") {
expand(mapOf("version" to project.properties["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"
}
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()
}
tasks.withType<Jar> {
from("LICENSE") {
rename { "${it}_${project.properties["archivesBaseName"]}" }
}
}
publishing {
repositories {
mavenLocal()
if (project.hasProperty("my_maven_username")) {
maven {
url = URI("https://maven.example.com")
credentials {
username = "${project.properties["my_maven_username"]}"
password = "${project.properties["my_maven_password"]}"
}
}
}
}
publications {
register("mavenJava", MavenPublication::class) {
artifactId = project.properties["archives_base_name"] as String
from(components["java"])
}
}
}