forked from TeamWizardry/LibrarianLib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
115 lines (99 loc) · 2.98 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val modVersion: String by ext.properties
val modName: String by ext.properties
val modGroup: String by ext.properties
val corePlugin: String by ext.properties
plugins {
`java-library`
`maven-publish`
kotlin("jvm") version("2.0.0")
id("com.gtnewhorizons.retrofuturagradle") version("1.3.35")
}
minecraft {
mcVersion.set("1.12.2")
extraRunJvmArguments.add("-Dfml.coremods.load=${corePlugin}")
}
version = modVersion
description = "A library for the TeamWizardry mods, continuously maintained by CleanroomMC."
base.archivesBaseName = modName + "-" + minecraft.mcVersion.get()
sourceSets["main"].allSource.srcDir("src/example/java")
sourceSets["main"].allSource.srcDir("src/api/java")
sourceSets["main"].resources.srcDir("src/example/resources")
repositories {
maven {
name = "CleanroomMC"
url = uri("https://maven.cleanroommc.com")
}
}
dependencies {
api("io.github.chaosunity.forgelin:Forgelin-Continuous:2.0.0.0") {
isTransitive = false
}
runtimeOnly("io.github.chaosunity.forgelin:Forgelin-Continuous:2.0.0.0") {
isTransitive = false
}
}
tasks {
getByName<Jar>("jar") {
manifest {
attributes(
"FMLCorePluginContainsFMLMod" to true,
"FMLCorePlugin" to corePlugin,
)
}
}
getByName<ProcessResources>("processResources") {
val props = mapOf(
"version" to project.version,
"mcversion" to minecraft.mcVersion
)
inputs.properties(props)
from(sourceSets["main"].resources.srcDirs) {
include("mcmod.info")
expand(props)
duplicatesStrategy = DuplicatesStrategy.WARN
}
from(sourceSets["main"].resources.srcDirs) {
exclude("mcmod.info")
duplicatesStrategy = DuplicatesStrategy.WARN
}
}
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
javaParameters.set(true)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
freeCompilerArgs.add("-Xjvm-default=all-compatibility")
}
}
withType<JavaCompile> {
options.encoding = "UTF-8"
targetCompatibility = "1.8"
sourceCompatibility = "1.8"
}
}
kotlin {
jvmToolchain(8)
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = modGroup
artifactId = modName
version = modVersion
from(components["java"])
}
}
repositories {
maven {
name = "CleanroomMavenLibrarianLib"
url = uri("https://repo.cleanroommc.com/releases")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
}