-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
90 lines (76 loc) · 2.43 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
plugins {
id("java")
id("idea")
id("fabric-loom") version "1.8.9" apply false
}
subprojects {
apply(plugin = "java-library")
apply(plugin = "idea")
apply(plugin = "maven-publish")
repositories {
mavenCentral()
mavenLocal()
// Add parchment and modrinth maven repositories for convenience
// filters are added so only relevant dependencies are queried from these repos
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
}
}
filter {
includeGroup("maven.modrinth")
}
}
exclusiveContent {
forRepository {
maven {
name = "Parchment"
url = uri("https://maven.parchmentmc.org")
}
}
filter {
includeGroup("org.parchmentmc.data")
}
}
}
// tell idea to download sources and javadocs when importing
idea {
module {
isDownloadSources = true
isDownloadJavadoc = true
}
}
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
}