-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle
92 lines (77 loc) · 2.92 KB
/
build.gradle
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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.145'
}
tasks.named('wrapper', Wrapper).configure {
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
distributionType = Wrapper.DistributionType.BIN
}
repositories {
mavenLocal()
}
group = maven_group
version = version
archives_base_name += "-mc${minecraft_version}"
if (build_number != "undefined") {
version += "+build.${build_number}"
}
java {
archivesBaseName = archives_base_name
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
// Put repositories for dependencies here
// ForgeGradle automatically adds the Forge maven and Maven Central for you
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
// flatDir {
// dir 'libs'
// }
}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
}
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
version : version,
loader_version_range : loader_version_range,
minecraft_version_range: minecraft_version_range,
neo_version_range : neo_version_range,
mod_id : mod_id,
mod_name: mod_name
]
inputs.properties replaceProperties
filesMatching(['META-INF/neoforge.mods.toml']) {
expand replaceProperties
}
}
jar {
manifest {
attributes([
"Specification-Title" : "curtain",
"Specification-Vendor" : "Gugle",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "Gugle",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
tasks.register('generateRulesReadme', JavaExec) {
group = "documentation"
description = "Generates a RULES.MD file for the rules directory"
classpath sourceSets.main.runtimeClasspath
mainClass = "dev.dubhe.curtain.utils.CurtainRulesGenerator"
}