-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
197 lines (161 loc) · 4.1 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import net.fabricmc.loom.task.RemapJarTask
plugins {
id 'fabric-loom' version "1.6-SNAPSHOT"
id 'io.github.ladysnake.chenille' version '0.13.1'
}
version = project.mod_version
group = project.maven_group
base {
archivesName = project.archives_base_name
}
chenille {
configureTestmod {
withBaseTestRuns()
withDependencyConfiguration()
}
license = project.license_header
javaVersion = project.java_version.toInteger()
}
java {
withSourcesJar()
}
loom {
splitEnvironmentSourceSets()
mods {
"blabber" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
"babblings" {
sourceSet sourceSets.testmod
}
}
}
sourceSets {
reiDummy
testmod {
compileClasspath += client.compileClasspath
runtimeClasspath += client.runtimeClasspath
}
test {
compileClasspath += testmod.compileClasspath
runtimeClasspath += testmod.runtimeClasspath
}
}
repositories {
chenille.repositories.allCommonRepositories()
maven {
url "https://maven.shedaniel.me"
content {
includeGroup("me.shedaniel")
includeGroup("dev.architectury")
}
}
}
dependencies {
testmodImplementation(sourceSets.client.output)
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modIncludeImplementation(libs.cca.base)
modIncludeImplementation(libs.cca.entity)
modIncludeImplementation(libs.permissionsApi)
modLocalImplementation(libs.rei.api)
compileOnly(sourceSets.reiDummy.output)
modCompileOnly(libs.emi)
modCompileOnly(libs.jei)
compileOnly(libs.mcAnnotations)
modLocalRuntime(libs.modmenu)
// Test dependencies
modLocalImplementation(libs.elmendorf)
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation "net.fabricmc:fabric-loader-junit:${project.loader_version}"
testImplementation(sourceSets.testmod.output)
}
test {
useJUnitPlatform()
maxHeapSize = '1G'
workingDir(project.layout.buildDirectory)
testLogging {
events("passed", "skipped", "failed")
}
}
license {
exclude 'me/shedaniel/**/*'
exclude 'org/ladysnake/blabber/impl/common/validation/EitherCodecButGood.java'
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
jar {
from("COPYING.LESSER") {
rename { "LICENSE_${project.archivesBaseName}"}
}
}
remapJar {
addNestedDependencies.set(false)
}
tasks.register("standaloneJar", Jar) {
from sourceSets.main.output
from sourceSets.client.output
archiveClassifier.set('standalone-dev')
dependsOn project.classes
}
tasks.register("remapStandaloneJar", RemapJarTask) {
archiveClassifier.set('standalone')
inputFile.set(standaloneJar.archiveFile)
addNestedDependencies.set(true)
dependsOn project.standaloneJar
}
assemble.dependsOn(remapStandaloneJar)
var testmodJar = tasks.register('testmodJar', Jar) {
dependsOn testmodClasses
archiveBaseName.set('Babblings')
archiveClassifier.set('dev')
from(sourceSets.testmod.output) {
include 'fabric.mod.json'
expand 'version': project.version
}
from(sourceSets.testmod.output) {
exclude 'fabric.mod.json'
}
}
var remapTestmodJar = tasks.register('remapTestmodJar', RemapJarTask) {
dependsOn project.testmodJar
archiveBaseName.set('Babblings')
inputFile.set(testmodJar.get().archiveFile)
addNestedDependencies = false
}
build.dependsOn(remapTestmodJar)
chenille {
configurePublishing {
mainArtifact = remapStandaloneJar.archiveFile
withLadysnakeMaven()
withCurseforgeRelease()
withGithubRelease()
withModrinthRelease()
}
}
publishing {
publications {
create("relocation", MavenPublication) {
pom {
// Old artifact coordinates
groupId = "io.github.ladysnake"
distributionManagement {
relocation {
// New artifact coordinates
groupId = "org.ladysnake"
message = "groupId has been changed"
}
}
}
}
}
}