-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathbuild.gradle
121 lines (100 loc) · 3.21 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
import net.minecraftforge.gradleutils.PomUtils
import net.ltgt.gradle.errorprone.ErrorProneOptions
import net.ltgt.gradle.nullaway.NullAwayOptions
plugins {
id 'java-library'
id 'maven-publish'
id 'org.gradlex.extra-java-module-info' version '1.11'
id 'net.minecraftforge.gradleutils' version '2.4.13'
id 'net.minecraftforge.licenser' version '1.1.1'
// Enforce jSpecify annotations at compile-time
id 'net.ltgt.errorprone' version '4.1.0'
id 'net.ltgt.nullaway' version '2.2.0'
}
group = 'net.minecraftforge'
version = gitversion.version.tagOffset
print "Version: $version"
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
modularity.inferModulePath = true
withSourcesJar()
}
repositories {
mavenCentral()
maven gradleutils.forgeMaven
}
dependencies {
api libs.jspecify.annotations
errorprone libs.errorprone.core
errorprone libs.nullaway
}
extraJavaModuleInfo {
failOnMissingModuleInfo = false
}
changelog {
from '1.0.0'
}
tasks.withType(JavaCompile).configureEach {
// Set up compile-time enforcement of the jSpecify spec via ErrorProne and NullAway
options.errorprone { ErrorProneOptions errorProne ->
errorProne.disableAllChecks = true // Opt-into only the checks we care about
// Enforce the jSpecify spec
errorProne.nullaway { NullAwayOptions nullAway ->
nullAway.jspecifyMode = true
nullaway.onlyNullMarked = true // Only enforce nullability checks on @NullMarked classes and packages
nullAway.error() // Throw a compile error on jSpecify spec violations
}
// Enforce the ErrorProne checks we care about
errorProne.error("FieldCanBeFinal", "MethodCanBeStatic", "LambdaFunctionalInterface")
}
}
tasks.named('jar', Jar) {
manifest {
attributes([
'Specification-Title': 'EventBus',
'Specification-Version': gitversion.version.info.tag,
'Specification-Vendor': 'Forge Development LLC',
'Implementation-Title': 'EventBus',
'Implementation-Version': project.version,
'Implementation-Vendor': 'Forge Development LLC'
])
}
reproducibleFileOrder = true
preserveFileTimestamps = false
}
license {
header = file("LICENSE-header.txt")
newLine = false
}
publishing {
publications.register('mavenJava', MavenPublication) {
from components.java
artifactId = 'eventbus'
pom {
name = 'EventBus'
description = 'High performance Event Bus library'
gradleutils.pom.gitHubDetails = pom
license PomUtils.Licenses.LGPLv2_1
developers {
developer PomUtils.Developers.Paint_Ninja
}
}
}
repositories {
maven gradleutils.publishingForgeMaven
}
}
allprojects {
ext.VALID_VMS = [
'Adoptium': [21],
'Amazon': [21],
'Azul': (21),
'BellSoft': (21),
'Graal_VM': [21],
'Microsoft': [21],
'Oracle': (21),
]
// Tests are expensive to run all variants, so only run if asked to
if (!project.hasProperty('bulk_tests'))
ext.VALID_VMS = ['Adoptium': [21]]
}