forked from IrisShaders/Iris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
127 lines (101 loc) · 3.74 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
127
plugins {
id("idea")
id("net.neoforged.moddev") version "2.0.28-beta"
id("java-library")
}
val MINECRAFT_VERSION: String by rootProject.extra
val PARCHMENT_VERSION: String? by rootProject.extra
val NEOFORGE_VERSION: String by rootProject.extra
val MOD_VERSION: String by rootProject.extra
base {
archivesName = "iris-neoforge"
}
sourceSets {
}
repositories {
maven("https://maven.su5ed.dev/releases")
maven("https://maven.neoforged.net/releases/")
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
}
}
filter {
includeGroup("maven.modrinth")
}
}
}
tasks.jar {
from(rootDir.resolve("LICENSE.md"))
filesMatching("neoforge.mods.toml") {
expand(mapOf("version" to MOD_VERSION))
}
manifest.attributes["Main-Class"] = "net.irisshaders.iris.LaunchWarn"
}
// NeoGradle compiles the game, but we don't want to add our common code to the game's code
val notNeoTask: (Task) -> Boolean = { it: Task -> !it.name.startsWith("neo") && !it.name.startsWith("compileService") }
tasks.withType<JavaCompile>().matching(notNeoTask).configureEach {
source(project(":common").sourceSets.main.get().allSource)
source(project(":common").sourceSets.getByName("vendored").allSource)
source(project(":common").sourceSets.getByName("api").allSource)
source(project(":common").sourceSets.getByName("desktop").allSource)
}
tasks.withType<Javadoc>().matching(notNeoTask).configureEach {
source(project(":common").sourceSets.main.get().allJava)
}
tasks.withType<ProcessResources>().matching(notNeoTask).configureEach {
from(project(":common").sourceSets.main.get().resources)
}
tasks.jar.get().destinationDirectory = rootDir.resolve("build").resolve("libs")
neoForge {
// Specify the version of NeoForge to use.
version = NEOFORGE_VERSION
if (PARCHMENT_VERSION != null) {
parchment {
minecraftVersion = MINECRAFT_VERSION
mappingsVersion = PARCHMENT_VERSION
}
}
runs {
create("client") {
client()
}
}
mods {
create("sodium") {
sourceSet(sourceSets.main.get())
}
}
}
fun includeDep(dependency: String, closure: Action<ExternalModuleDependency>) {
dependencies.implementation(dependency, closure)
dependencies.jarJar(dependency, closure)
}
fun includeDep(dependency: String) {
dependencies.implementation(dependency)
dependencies.jarJar(dependency)
}
fun includeAdditional(dependency: String) {
includeDep(dependency)
dependencies.additionalRuntimeClasspath(dependency)
}
tasks.named("compileTestJava").configure {
enabled = false
}
dependencies {
compileOnly(files(rootDir.resolve("DHApi.jar")))
compileOnly(project.project(":common").sourceSets.main.get().output)
compileOnly(project.project(":common").sourceSets.getByName("vendored").output)
compileOnly(project.project(":common").sourceSets.getByName("headers").output)
compileOnly(project.project(":common").sourceSets.getByName("api").output)
includeDep("org.sinytra.forgified-fabric-api:fabric-api-base:0.4.42+d1308ded19")
includeDep("org.sinytra.forgified-fabric-api:fabric-renderer-api-v1:3.4.0+acb05a3919")
includeDep("org.sinytra.forgified-fabric-api:fabric-rendering-data-attachment-v1:0.3.48+73761d2e19")
includeDep("org.sinytra.forgified-fabric-api:fabric-block-view-api-v2:1.0.10+9afaaf8c19")
implementation("maven.modrinth", "sodium", "mc1.21.1-0.6.0-neoforge")
includeAdditional("io.github.douira:glsl-transformer:2.0.1")
includeAdditional("org.anarres:jcpp:1.4.14")
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)