-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle
More file actions
79 lines (66 loc) · 2.24 KB
/
build.gradle
File metadata and controls
79 lines (66 loc) · 2.24 KB
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
plugins {
id "architectury-plugin" version "${architectury_plugin_version}"
id "dev.architectury.loom" version "${architectury_loom_version}" apply false
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
}
architectury {
minecraft = project.minecraft_version
}
subprojects {
apply plugin: "dev.architectury.loom"
loom {
silentMojangMappingsLicense()
}
}
allprojects {
repositories {
maven { url 'https://maven.fabricmc.net/' }
maven { url 'https://maven.architectury.dev/' }
maven { url 'https://maven.neoforged.net/releases/' }
maven { url 'https://maven.minecraftforge.net/' }
maven { url 'https://maven.isxander.dev/releases' }
maven { url 'https://maven.terraformersmc.com/' }
maven { url 'https://thedarkcolour.github.io/KotlinForForge/' }
maven { url 'https://maven.latvian.dev/releases' }
maven { url 'https://jitpack.io' }
maven { url 'https://api.modrinth.com/maven' }
maven { url 'https://repo.minebench.de/' }
mavenCentral()
}
}
subprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
def javaRelease = Integer.parseInt(project.findProperty("java_version")?.toString() ?: "17")
base {
archivesName = "${rootProject.archives_base_name}-${project.name}-${rootProject.minecraft_version}"
}
version = rootProject.mod_version
group = rootProject.maven_group
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release = javaRelease
}
java {
withSourcesJar()
}
tasks.named("jar") {
from("${rootProject.rootDir}/LICENSE")
from("${rootProject.rootDir}/NOTICE")
}
}
task collectJars(type: Copy) {
subprojects.each {
if (it.path.contains("fabric") || it.path.contains("neoforge")) {
dependsOn it.tasks.named("remapJar")
from it.tasks.named("remapJar").get().archiveFile
}
}
into rootProject.layout.buildDirectory.dir("libs")
}
task copyToMods(type: Copy) {
dependsOn collectJars
from rootProject.layout.buildDirectory.dir("libs")
into project.findProperty("modsFolder") ?: "build/mods"
}