-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
84 lines (68 loc) · 2.08 KB
/
build.gradle
File metadata and controls
84 lines (68 loc) · 2.08 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
80
81
82
83
84
plugins {
id 'fabric-loom' version "${loom_version}" apply false
id 'net.fabricmc.fabric-loom' version "${loom_version}" apply false
id 'glue' version '0.1.0'
id 'maven-publish'
}
glue {
// subproject names in the order they'll be glued
targets = ['1_14', '1_16', '1_20_5', '1_21_2', '1_21_5', '26_1', 'glue']
// output path defaults to build/libs/archives_base_name-mod_version.jar
outputName = "${project.archives_base_name}-${project.mod_version}-universal"
overrides = targets.findAll { it != 'glue' }.collectEntries {
[
("creativeonepunch.${it}.mixins.json".toString()): [
"compatibilityLevel": "JAVA_8",
"plugin": "io.github.fourmisain.creativeonepunch.GlueMixinPlugin"
]
]
}
}
allprojects {
version = rootProject.mod_version
group = rootProject.maven_group
}
subprojects {
def obfuscated = project.hasProperty('yarn_mappings')
apply plugin: (obfuscated ? 'fabric-loom' : 'net.fabricmc.fabric-loom')
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
if (obfuscated) {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
} else {
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
}
}
base {
archivesName = project.archives_base_name
}
processResources {
inputs.property 'version', project.version
filesMatching('fabric.mod.json') {
expand 'version': inputs.properties.version
}
}
jar {
inputs.property 'archivesName', project.base.archivesName
from('../LICENSE') {
rename { "${it}_${inputs.properties.archivesName}" }
}
}
java {
targetCompatibility = sourceCompatibility = project.java_version as Integer
}
tasks.withType(JavaCompile).configureEach {
it.options.release = project.java_version as Integer
}
}
publishing {
publications {
create('mavenJava', MavenPublication) {
artifactId = project.archives_base_name
assert tasks.glue.outputs.files.size() == 1
artifact tasks.glue.outputs.files.first()
}
}
}
tasks.withType(AbstractPublishToMaven).configureEach { dependsOn('glue') }