-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
126 lines (109 loc) · 3.42 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
/*
* Copyright 2024 - present CommunityRadarGG <https://community-radar.de/>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.cadixdev.gradle.licenser.LicenseExtension
plugins {
id("fabric-loom") version("1.7-SNAPSHOT")
id("org.cadixdev.licenser") version("0.6.1")
java
idea
}
version = project.extra["mod_version"] as String
group = project.extra["maven_group"] as String
base {
archivesName.set(project.extra["archives_base_name"] as String)
}
repositories {
flatDir {
dirs("lib")
}
mavenCentral()
}
dependencies {
// To change the versions see the gradle.properties file
minecraft("com.mojang:minecraft:${project.extra["minecraft_version"]}")
mappings("net.fabricmc:yarn:${project.extra["yarn_mappings"]}:v2")
modImplementation("net.fabricmc:fabric-loader:${project.extra["loader_version"]}")
// Make a set of all api modules we wish to use
setOf(
"fabric-api-base",
"fabric-command-api-v2"
).forEach {
// Add each module as a dependency
modImplementation(fabricApi.module(it, project.extra["fabric_version"] as String))
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
withSourcesJar()
// withJavadocJar()
}
tasks {
withType<ProcessResources> {
// https://github.com/gradle/gradle/issues/861
outputs.upToDateWhen { false }
filteringCharset = Charsets.UTF_8.name()
filesMatching("fabric.mod.json") {
expand(
"version" to project.version,
"loader_version" to project.extra["loader_version"],
"minecraft_version" to project.extra["minecraft_version"],
"website" to project.extra["website"],
"source" to project.extra["source"],
"discord" to project.extra["discord"]
)
}
}
withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
withType<Javadoc> {
with(options as StandardJavadocDocletOptions) {
encoding(Charsets.UTF_8.name())
addStringOption("Xdoclint:reference,syntax,html,missing", "-quiet")
keyWords()
linkSource()
use()
}
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}" }
}
}
}
}
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
configure<LicenseExtension> {
newLine(false)
header(rootProject.file("HEADER"))
properties {
set("year", "2024 - present")
set("name", "CommunityRadarGG <https://community-radar.de/>")
}
tasks {
create("gradle") {
@Suppress("UnstableAPIUsage") // needed at that location
files.from("build.gradle.kts", "settings.gradle.kts", "gradle.properties")
}
}
}