forked from unilock/etched
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
113 lines (90 loc) · 2.85 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
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
}
archivesBaseName = "${rootProject.archivesBaseName}-${project.name}"
loom {
forge {
mixinConfig "${project.mod_id}-common.mixins.json"
mixinConfig "${project.mod_id}.mixins.json"
dataGen {
mod project.mod_id
}
}
launches {
data {
arg "--existing", file("src/main/resources").absolutePath
}
}
}
architectury {
platformSetupLoomIde()
forge()
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common
}
dependencies {
forge "net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}"
modApi("gg.moonflower:pollen-forge:${rootProject.pollen_version}")
modRuntimeOnly "me.djtheredstoner:DevAuth-forge-latest:${rootProject.devauth_version}"
modRuntimeOnly "curse.maven:configured-457570:3640884"
modRuntimeOnly "curse.maven:catalogue-459701:3559402"
shadowCommon(implementation("javazoom:jlayer:1.0.1"))
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
}
processResources {
inputs.property "id", rootProject.mod_id
inputs.property "name", rootProject.mod_name
inputs.property "version", rootProject.mod_version
inputs.property "repo", rootProject.repo_name
filesMatching(["META-INF/mods.toml", "pack.mcmeta"]) {
expand "id": rootProject.mod_id,
"name": rootProject.mod_name,
"version": rootProject.mod_version,
"repo": rootProject.repo_name
}
doLast {
fileTree(dir: outputs.files.asPath, include: "**/*.json").each {
File file -> file.text = JsonOutput.toJson(new JsonSlurper().parse(file))
}
}
}
shadowJar {
exclude "fabric.mod.json"
relocate "fr.delthas.javamp3", "gg.moonflower.etched.lib.javamp3"
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier null
}
jar {
classifier "dev"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
publishing {
publications {
mavenForge(MavenPublication) {
artifactId = project.archivesBaseName
from components.java
}
}
}