Repository navigation
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
76 lines (64 loc) · 2.19 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
76 lines (64 loc) · 2.19 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
plugins {
id("java")
id("idea")
}
subprojects {
apply(plugin = "java-library")
apply(plugin = "idea")
apply(plugin = "maven-publish")
repositories {
mavenCentral()
mavenLocal()
maven("https://jitpack.io")
maven("https://maven.fabricmc.net/")
maven("https://maven.notenoughupdates.org/releases/")
maven("https://repo.codemc.io/repository/maven-public/")
maven("https://maven.azureaaron.net/releases")
maven("https://repo1.maven.org/maven2/")
maven("https://repo.nea.moe/releases")
maven("https://api.modrinth.com/maven")
maven("https://maven.neoforged.net/releases")
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
}
}
filter {
includeGroup("maven.modrinth")
}
}
}
java.toolchain.languageVersion = JavaLanguageVersion.of(rootProject.properties["java_version"].toString())
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(rootProject.properties["java_version"].toString().toInt())
}
withType<GenerateModuleMetadata>().configureEach {
enabled = false
}
jar {
// put all built jars in the correct directory
destinationDirectory = rootDir.resolve("build").resolve("libs_${project.name}")
// add license file to jars
from(rootDir.resolve("LICENSE.md"))
// required because apparently some classes are duplicated
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
version = properties["mod_version"].toString()
group = properties["mod_group"].toString()
base {
// format artifact names as [mod_id]-[loader]-[mc_version]-[mod_version].jar
archivesName =
"${rootProject.properties["mod_id"]}-${project.name}-${rootProject.properties["minecraft_version"]}"
}
dependencies {
compileOnly("org.jetbrains:annotations:26.0.1")
}
}
tasks.jar {
enabled = false
}