Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
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'
alias libs.plugins.modules
alias libs.plugins.gradleutils
alias libs.plugins.licenser

// Enforce jSpecify annotations at compile-time
id 'net.ltgt.errorprone' version '4.1.0'
id 'net.ltgt.nullaway' version '2.2.0'
alias libs.plugins.errorprone
alias libs.plugins.nullaway
}

final projectDisplayName = 'EventBus'
final projectVendor = 'Forge Development LLC'
description = 'High performance Event Bus library'
group = 'net.minecraftforge'
version = gitversion.version.tagOffset
version = gitversion.tagOffset

print "Version: $version"

java {
Expand All @@ -24,11 +27,6 @@ java {
withSourcesJar()
}

repositories {
mavenCentral()
maven gradleutils.forgeMaven
}

dependencies {
api libs.jspecify.annotations
errorprone libs.errorprone.core
Expand Down Expand Up @@ -56,19 +54,19 @@ tasks.withType(JavaCompile).configureEach {
}

// Enforce the ErrorProne checks we care about
errorProne.error("FieldCanBeFinal", "MethodCanBeStatic", "LambdaFunctionalInterface")
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',
'Specification-Title' : projectDisplayName,
'Specification-Version' : gitversion.info.tag,
'Specification-Vendor' : projectVendor,
'Implementation-Title' : projectDisplayName,
'Implementation-Version': project.version,
'Implementation-Vendor': 'Forge Development LLC'
'Implementation-Vendor' : projectVendor
])
}

Expand All @@ -77,7 +75,7 @@ tasks.named('jar', Jar) {
}

license {
header = file("LICENSE-header.txt")
header = file('LICENSE-header.txt')
newLine = false
}

Expand All @@ -86,15 +84,17 @@ publishing {
from components.java
artifactId = 'eventbus'
pom {
name = 'EventBus'
description = 'High performance Event Bus library'
name = projectDisplayName
description = project.description

gradleutils.pom.gitHubDetails = pom

license PomUtils.Licenses.LGPLv2_1
licenses {
license gradleutils.pom.licenses.LGPLv2_1
}

developers {
developer PomUtils.Developers.Paint_Ninja
developer gradleutils.pom.developers.Paint_Ninja
}
}
}
Expand All @@ -105,17 +105,17 @@ publishing {
}

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]]
else
ext.VALID_VMS = [
'Adoptium': [21],
'Amazon': [21],
'Azul': [21],
'BellSoft': [21],
'Graal_VM': [21],
'Microsoft': [21],
'Oracle': [21],
]
}
7 changes: 1 addition & 6 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ plugins {
id 'groovy'
}

repositories {
mavenCentral()
maven { url = 'https://jitpack.io' }
}

java.toolchain.languageVersion = JavaLanguageVersion.of(21)

dependencies {
implementation 'com.github.Steppschuh:Java-Markdown-Generator:1.3.2'
implementation libs.markdown.generator
}
12 changes: 12 additions & 0 deletions buildSrc/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rootProject.name = 'buildSrc'

dependencyResolutionManagement {
repositories {
mavenCentral()
maven { url = 'https://jitpack.io' }
}

versionCatalogs.register('libs') {
library 'markdown-generator', 'com.github.Steppschuh', 'Java-Markdown-Generator' version '1.3.2'
}
}
5 changes: 0 additions & 5 deletions buildSrc/src/main/groovy/ArchiveJfr.groovy
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import groovy.xml.DOMBuilder
import groovy.xml.dom.DOMCategory
import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction

import java.nio.file.Files
import java.nio.file.StandardCopyOption

abstract class ArchiveJfr extends DefaultTask {
@InputDirectory
Expand Down
14 changes: 4 additions & 10 deletions eventbus-jmh/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
plugins {
id 'java-library'
id 'org.gradlex.extra-java-module-info'
id 'net.minecraftforge.gradleutils'
id 'net.minecraftforge.licenser'
}

repositories {
mavenCentral()
maven gradleutils.forgeMaven
alias libs.plugins.modules
alias libs.plugins.gradleutils
alias libs.plugins.licenser
}

java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}

license {
header = rootProject.file("LICENSE-header.txt")
header = rootProject.file('LICENSE-header.txt')
newLine = false
}

Expand All @@ -33,7 +28,6 @@ dependencies {
extraJavaModuleInfo {
failOnMissingModuleInfo = false
automaticModule('org.openjdk.jmh:jmh-core', 'jmh.core')
automaticModule('net.sf.jopt-simple:jopt-simple', 'jopt.simple')
}

tasks.register('aggregateJmh', AggregateJmh) {
Expand Down
19 changes: 7 additions & 12 deletions eventbus-test-jar/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
plugins {
id 'eclipse'
id 'java-library'
id 'org.gradlex.extra-java-module-info'
id 'net.minecraftforge.gradleutils'
id 'net.minecraftforge.licenser'
}

repositories {
mavenCentral()
maven gradleutils.forgeMaven
alias libs.plugins.modules
alias libs.plugins.gradleutils
alias libs.plugins.licenser
}

java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}

dependencies {
implementation(rootProject)
implementation(libs.bundles.asm)
implementation(libs.unsafe)
implementation rootProject
implementation libs.bundles.asm
implementation libs.unsafe

implementation libs.jmh.core
}
Expand All @@ -29,7 +24,7 @@ extraJavaModuleInfo {
}

license {
header = rootProject.file("LICENSE-header.txt")
header = rootProject.file('LICENSE-header.txt')
newLine = false
}

Expand Down
19 changes: 8 additions & 11 deletions eventbus-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
plugins {
id 'eclipse'
id 'java-library'
id 'net.minecraftforge.gradleutils'
id 'net.minecraftforge.licenser'
id 'org.gradlex.extra-java-module-info'
alias libs.plugins.gradleutils
alias libs.plugins.licenser
alias libs.plugins.modules
id 'test-report-aggregation'
}

repositories {
mavenCentral()
maven gradleutils.forgeMaven
}

java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}

license {
header = rootProject.file("LICENSE-header.txt")
header = rootProject.file('LICENSE-header.txt')
newLine = false
}

Expand Down Expand Up @@ -48,13 +43,15 @@ tasks.register('testAll', AggregateTest) {
output.mkdirs()
var task = tasks.register("test${javaVendor}${javaVersion}", Test) {
useJUnitPlatform()
classpath = configurations.runtimeClasspath
testClassesDirs = sourceSets.main.output.classesDirs
javaLauncher = javaToolchains.launcherFor {
vendor = JvmVendorSpec."${javaVendor.toUpperCase(Locale.ROOT)}" as JvmVendorSpec
languageVersion = JavaLanguageVersion.of(javaVersion)
implementation = JvmImplementation.VENDOR_SPECIFIC
}
reports.html.destination = file("build/test-reports/${javaVendor}-${javaVersion}/")
reports.junitXml.destination = output
reports.html.outputLocation.fileValue file("build/test-reports/${javaVendor}-${javaVersion}/")
reports.junitXml.outputLocation.fileValue output
}
tasks.named('testAll') {
inputs.dir(output)
Expand Down
90 changes: 44 additions & 46 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
pluginManagement {
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.10.0'
}

dependencyResolutionManagement {
repositories {
gradlePluginPortal()
// TODO [Gradle9][GradleUtils3] Replace with gradleutils.forgeMaven
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0'
}
//@formatter:off
versionCatalogs.register('libs') {
plugin 'modules', 'org.gradlex.extra-java-module-info' version '1.11'
plugin 'gradleutils', 'net.minecraftforge.gradleutils' version '2.5.1'
plugin 'licenser', 'net.minecraftforge.licenser' version '1.2.0'

dependencyResolutionManagement {
versionCatalogs {
libs {
// https://mvnrepository.com/artifact/org.jspecify/jspecify
library('jspecify-annotations', 'org.jspecify', 'jspecify') version '1.0.0'

// https://mvnrepository.com/artifact/com.google.errorprone/error_prone_core
library('errorprone-core', 'com.google.errorprone', 'error_prone_core') version '2.36.0'

// https://mvnrepository.com/artifact/com.uber.nullaway/nullaway
library('nullaway', 'com.uber.nullaway', 'nullaway') version '0.12.4'

// ModLauncher stack
library('modlauncher', 'net.minecraftforge:modlauncher:10.1.1')
library('securemodules', 'net.minecraftforge:securemodules:2.2.21')
library('unsafe', 'net.minecraftforge:unsafe:0.9.2')

// Generics from lambdas
library('typetools', 'net.jodah:typetools:0.6.3')

library('nulls', 'org.jetbrains:annotations:23.0.0')
library('jopt-simple', 'net.sf.jopt-simple:jopt-simple:5.0.4')
library('log4j-api', 'org.apache.logging.log4j:log4j-api:2.17.1')

version('junit', '5.10.1')
library('junit-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit')
library('junit-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit')
library('junit-platform-launcher', 'org.junit.platform:junit-platform-launcher:1.10.1')
bundle('junit-runtime', ['junit-engine', 'junit-platform-launcher'])

version('asm', '9.7.1')
library('asm', 'org.ow2.asm', 'asm' ).versionRef('asm')
library('asm-tree', 'org.ow2.asm', 'asm-tree' ).versionRef('asm')
library('asm-commons', 'org.ow2.asm', 'asm-commons').versionRef('asm')
bundle('asm', ['asm', 'asm-tree', 'asm-commons'])

version('jmh', '1.37')
library('jmh-core', 'org.openjdk.jmh', 'jmh-core') versionRef 'jmh'
library('jmh-annotationProcessor', 'org.openjdk.jmh', 'jmh-generator-annprocess') versionRef 'jmh'
}
plugin 'errorprone', 'net.ltgt.errorprone' version '4.1.0'
plugin 'nullaway', 'net.ltgt.nullaway' version '2.2.0'

// https://mvnrepository.com/artifact/org.jspecify/jspecify
library 'jspecify-annotations', 'org.jspecify', 'jspecify' version '1.0.0'

// https://mvnrepository.com/artifact/com.google.errorprone/error_prone_core
library 'errorprone-core', 'com.google.errorprone', 'error_prone_core' version '2.36.0'

// https://mvnrepository.com/artifact/com.uber.nullaway/nullaway
library 'nullaway', 'com.uber.nullaway', 'nullaway' version '0.12.4'


/* The rest is for testing */
library 'unsafe', 'net.minecraftforge:unsafe:0.9.2'

version 'junit', '5.10.1'
library 'junit-api', 'org.junit.jupiter', 'junit-jupiter-api' versionRef 'junit'
library 'junit-engine', 'org.junit.jupiter', 'junit-jupiter-engine' versionRef 'junit'
library 'junit-platform-launcher', 'org.junit.platform', 'junit-platform-launcher' version '1.10.1'
bundle 'junit-runtime', ['junit-engine', 'junit-platform-launcher']

version 'asm', '9.7.1'
library 'asm', 'org.ow2.asm', 'asm' versionRef 'asm'
library 'asm-tree', 'org.ow2.asm', 'asm-tree' versionRef 'asm'
library 'asm-commons', 'org.ow2.asm', 'asm-commons' versionRef 'asm'
bundle 'asm', ['asm', 'asm-tree', 'asm-commons']

version 'jmh', '1.37'
library 'jmh-core', 'org.openjdk.jmh', 'jmh-core' versionRef 'jmh'
library 'jmh-annotationProcessor', 'org.openjdk.jmh', 'jmh-generator-annprocess' versionRef 'jmh'
}
//@formatter:on
}

enableFeaturePreview 'TYPESAFE_PROJECT_ACCESSORS'
Expand Down