-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
102 lines (91 loc) · 2.78 KB
/
Copy pathbuild.gradle
File metadata and controls
102 lines (91 loc) · 2.78 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
plugins {
id 'base'
id 'com.diffplug.spotless' version '6.25.0'
}
repositories {
mavenCentral()
}
allprojects {
group = findProperty('mod_group_id') ?: 'com.alanjmrt94.consolefilternext'
repositories {
mavenCentral()
}
}
subprojects {
pluginManager.withPlugin('java') {
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['-Xlint:all', '-Xlint:-serial', '-Xlint:-processing'])
if (findProperty('failOnWarnings') == 'true') {
options.compilerArgs.add('-Werror')
}
}
}
pluginManager.withPlugin('java-library') {
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['-Xlint:all', '-Xlint:-serial', '-Xlint:-processing'])
if (findProperty('failOnWarnings') == 'true') {
options.compilerArgs.add('-Werror')
}
}
}
}
// Formato / imports no usados sobre todo el árbol Java del monorepo (incl. loaders aislados).
spotless {
java {
target(
'common/src/**/*.java',
'client/src/**/*.java',
'forge/src/**/*.java',
'fabric/src/**/*.java',
'neoforge/src/**/*.java'
)
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
}
tasks.register('lintCheck') {
group = 'verification'
description = 'Verifica formato Spotless (imports no usados, whitespace)'
dependsOn 'spotlessCheck'
}
tasks.register('lintCi') {
group = 'verification'
description = 'Lint CI: Spotless + compile common/forge con -Werror'
dependsOn 'spotlessCheck', ':common:compileJava', ':forge:compileJava'
}
tasks.register('lintFix') {
group = 'formatting'
description = 'Aplica autofix Spotless (imports no usados, whitespace)'
dependsOn 'spotlessApply'
}
tasks.named('build').configure {
dependsOn ':common:build', ':forge:build'
}
tasks.register('testAll') {
group = 'verification'
description = 'Ejecuta tests de common y forge'
dependsOn ':common:test', ':forge:test'
}
tasks.register('buildFabric') {
group = 'build'
description = 'Compila el adaptador Fabric (wrapper Gradle 9 + Loom aislado)'
doLast {
exec {
workingDir = file('fabric')
commandLine './gradlew', 'build', '--no-daemon'
}
}
}
tasks.register('testFabric') {
group = 'verification'
description = 'Tests del adaptador Fabric'
doLast {
exec {
workingDir = file('fabric')
commandLine './gradlew', 'test', '--no-daemon'
}
}
}