-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
134 lines (113 loc) · 4.78 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
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
128
129
130
131
132
133
134
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
// Uses Architectury plugin https://github.com/architectury/architectury-plugin
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false // Uses Architectury Loom
id "me.shedaniel.unified-publishing" version "0.1.+" apply false // Uses Unified Publishing plugin
id "org.cadixdev.licenser" version "0.6.1" apply false // Uses Licensing plugin
}
architectury {
minecraft = rootProject.minecraft_version // Sets Minecraft version from gradle.properties
}
allprojects {
def runNumber = (System.getenv("GITHUB_RUN_NUMBER") == null ? "9999" : System.getenv("GITHUB_RUN_NUMBER"))
version = rootProject.mod_version + "-" + runNumber
group = rootProject.maven_group
gradle.projectsEvaluated {
tasks.withType(JavaCompile).tap {
configureEach {
options.compilerArgs << "-Xlint:unchecked" //<< "-Xlint:deprecation"
}
}
}
// Set mod relations
ec_mod_compat_enabled = minecraft_version == "1.20.1" || minecraft_version == "1.21" || minecraft_version == "1.21.1"
lunar_mod_compat_enabled = minecraft_version == "1.20.1" || minecraft_version == "1.21" || minecraft_version == "1.21.1"
cm_mod_compat_enabled = minecraft_version == "1.19" || minecraft_version == "1.19.1"
}
subprojects {
apply plugin: "dev.architectury.loom" // Applies Architectury Loom to subprojects
apply plugin: "architectury-plugin" // Applies architectury plugin to all projects
apply plugin: "me.shedaniel.unified-publishing" // Applies Unified Publishing to subprojects
apply plugin: 'org.cadixdev.licenser' // Applies licenser plugin to all projects
apply plugin: "maven-publish"
base {
// Set up a suffixed format for the mod jar names, e.g. `example-fabric`.
archivesName = "$rootProject.archives_base_name-$project.name"
}
repositories {
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
maven { url "https://maven.draylar.dev/releases" }
maven { url "https://api.modrinth.com/maven" }
maven { url "https://maven.nucleoid.xyz/" }
}
loom {
silentMojangMappingsLicense() // Silences the annoying Mojang License text
}
dependencies {
minecraft "net.minecraft:minecraft:$rootProject.minecraft_version"
mappings loom.officialMojangMappings()
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}
jar {
from(rootProject.file("LICENSE")) {
rename { "${it}_${mod_id}" }
}
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_author,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestamp' : System.currentTimeMillis(),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Build-On-Minecraft' : minecraft_version
])
}
}
license {
setHeader(rootProject.file("LICENSE_HEADER"))
ext {
name = "Urkaz - Fran Sánchez"
year = "2025"
modname = rootProject.mod_name
}
include "**/*.java"
ignoreFailures = true
}
publishing {
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
if (System.getenv("urkaz_maven_pass") != null) {
maven {
name "${archives_base_name}"
url "https://maven.franserver.mywire.org/releases"
credentials {
username = "autodeploy"
password = System.getenv("urkaz_maven_pass")
}
}
}
}
}
}
tasks.register('modPublish')