-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
99 lines (82 loc) · 2.71 KB
/
build.gradle.kts
File metadata and controls
99 lines (82 loc) · 2.71 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
plugins {
`maven-publish`
id("hytale-mod") version "0.+"
}
group = "com.example"
version = "0.1.0"
val javaVersion = 25
repositories {
mavenCentral()
maven("https://maven.hytale-mods.dev/releases") {
name = "HytaleModdingReleases"
}
}
dependencies {
compileOnly(libs.jetbrains.annotations)
compileOnly(libs.jspecify)
// this mod is optional, but is included so you can preview your mod icon
// in the in-game mod list via the /modlist command
runtimeOnly(libs.bettermodlist)
}
hytale {
// uncomment if you want to add the Assets.zip file to your external libraries;
// !!! CAUTION, this file is very big and might make your IDE unresponsive for some time !!!
//
// addAssetsDependency = true
// uncomment if you want to develop your mod against the pre-release version of the game.
//
// updateChannel = "pre-release"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
withSourcesJar()
}
tasks.named<ProcessResources>("processResources") {
var replaceProperties = mapOf(
"plugin_group" to findProperty("plugin_group"),
"plugin_maven_group" to project.group,
"plugin_name" to project.name,
"plugin_version" to project.version,
"server_version" to findProperty("server_version"),
"plugin_description" to findProperty("plugin_description"),
"plugin_website" to findProperty("plugin_website"),
"plugin_main_entrypoint" to findProperty("plugin_main_entrypoint"),
"plugin_author" to findProperty("plugin_author")
)
filesMatching("manifest.json") {
expand(replaceProperties)
}
inputs.properties(replaceProperties)
}
tasks.withType<Jar> {
manifest {
attributes["Specification-Title"] = rootProject.name
attributes["Specification-Version"] = version
attributes["Implementation-Title"] = project.name
attributes["Implementation-Version"] =
providers.environmentVariable("COMMIT_SHA_SHORT")
.map { "${version}-${it}" }
.getOrElse(version.toString())
}
}
publishing {
repositories {
// This is where you put repositories that you want to publish to.
// Do NOT put repositories for your dependencies here.
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
val runningOnCI = providers.environmentVariable("CI").orNull.toBoolean()
idea {
module {
isDownloadSources = !runningOnCI
isDownloadJavadoc = !runningOnCI
}
}