-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
167 lines (143 loc) · 4.87 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import ca.stellardrift.build.configurate.ConfigFormats
import ca.stellardrift.build.configurate.transformations.ConfigurateTransformations
plugins {
id 'net.ltgt.errorprone' version '3.1.0'
id 'fabric-loom' version '1.6.6'
id 'ca.stellardrift.opinionated' version '6.1.0'
id 'ca.stellardrift.configurate-transformations' version '6.1.0'
id 'net.kyori.indra.publishing.sonatype' version '3.1.3'
}
group = "ca.stellardrift"
version = "3.0.0-SNAPSHOT"
description = "$longDescription"
indra.javaVersions {
target(17)
}
repositories {
stellardrift.releases()
stellardrift.snapshots()
}
tasks.withType(Jar).configureEach {
manifest {
attributes "Specification-Title": "Configurate",
"Specification-Version": versionConfigurate,
"Implementation-Title": project.name,
"Implementation-Version": project.version
}
}
tasks.withType(Javadoc).configureEach {
options.links(
"https://configurate.aoeu.xyz/$versionConfigurate/apidocs/"
)
}
sourceSets {
register("testmod") {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
java.srcDirs("src/testmodMixin/java")
resources.srcDirs("src/testmodMixin/resources")
}
}
dependencies {
testmodImplementation sourceSets.main.output
}
loom {
runs {
register("testmodClient") {
source("testmod")
client()
}
register("testmodServer") {
source("testmod")
server()
}
}
}
tasks.withType(net.fabricmc.loom.task.RunGameTask) {
javaLauncher.set(javaToolchains.launcherFor { languageVersion.set(indra.javaVersions().target().map { v -> JavaLanguageVersion.of(v) })})
}
// Convert yaml files to josn
tasks.withType(ProcessResources).configureEach {
inputs.property("versionConfigurate", versionConfigurate)
// Convert data files yaml -> json
filesMatching(
[
"fabric.mod",
"data/**/*",
"assets/**/*"
].collect { base -> ["${base}.yml".toString(), "${base}.yaml".toString()] }
.flatten()
) {
ConfigurateTransformations.convertFormat(it, ConfigFormats.YAML, ConfigFormats.JSON)
if (name.startsWith("fabric.mod")) {
expand project: project, versionConfigurate: versionConfigurate
}
name = name.substring(0, name.lastIndexOf('.')) + ".json"
}
// Convert pack meta, without changing extension
filesMatching("pack.mcmeta") { convertFormat(ConfigFormats.YAML, ConfigFormats.JSON) }
}
loom {
decompilerOptions.vineflower {
options.put("win", "0")
}
}
configurations.runtimeClasspath {
extendsFrom configurations.vineflowerDecompilerClasspath
}
afterEvaluate {
tasks.named("genSources") {
dependsOn = ["genSourcesWithVineflower"]
}
}
dependencies {
vineflowerDecompilerClasspath("org.vineflower:vineflower:$versionVineflower")
compileOnly "com.google.errorprone:error_prone_annotations:$versionErrorprone"
errorprone "com.google.errorprone:error_prone_core:$versionErrorprone"
compileOnlyApi "org.checkerframework:checker-qual:3.42.0"
minecraft "com.mojang:minecraft:$versionMinecraft"
mappings loom.layered {
officialMojangMappings()
parchment "org.parchmentmc.data:parchment-$versionParchment@zip"
}
modImplementation "net.fabricmc:fabric-loader:$versionLoader"
modImplementation "net.fabricmc.fabric-api:fabric-api:$versionFabricApi"
// We can't add the bom because loom doesn't put it into our pom correctly
include modApi("org.spongepowered:configurate-core:$versionConfigurate")
include modApi("org.spongepowered:configurate-hocon:$versionConfigurate")
include(modApi("org.spongepowered:configurate-gson:$versionConfigurate") {
exclude group: "com.google.code.gson" // Use Minecraft's gson
})
include(modApi("org.spongepowered:configurate-extra-dfu4:$versionConfigurate") {
exclude group: "com.mojang" // Use the game's DFU version
})
include "com.typesafe:config:1.4.3"
include api("io.leangen.geantyref:geantyref:1.3.15")
checkstyle "ca.stellardrift:stylecheck:0.2.1"
}
indra {
github("zml2008", "confabricate") {
ci(true)
}
apache2License()
configurePublications {
pom {
developers {
developer {
name = "zml"
email = "zml at stellardrift dot ca"
}
}
}
}
publishAllTo("pex", "https://repo.glaremasters.me/repository/permissionsex")
publishReleasesTo("stellardrift", "https://repo.stellardrift.ca/repository/releases/")
publishSnapshotsTo("stellardrift", "https://repo.stellardrift.ca/repository/snapshots/")
}
// Workaround for both loom and indra doing publication logic in an afterEvaluate :(
indra.includeJavaSoftwareComponentInPublications(false)
publishing {
publications.maven {
from components.java
}
}