Skip to content

Commit 308704f

Browse files
committed
Use JVM Aggregate Testing plugin to cleanup buildscript
1 parent 4ebfe35 commit 308704f

File tree

11 files changed

+76
-114
lines changed

11 files changed

+76
-114
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
/forge-deobfed.jar
3030
/out.log
3131
/**/logs/
32-
/test_results.html
32+
at-test/aggregate-test-results.html

at-jmh/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id 'idea'
44
id 'eclipse'
55
alias libs.plugins.licenser
6+
alias libs.plugins.gradleutils
67
}
78

89
configurations {
@@ -59,6 +60,3 @@ tasks.register('jmh', JavaExec) {
5960
args '-rff', "${rootProject.layout.buildDirectory.asFile.get()}/jmh_results.txt" // results file
6061
args 'net.minecraftforge.accesstransformer.benchmarks.AccessTransformerListBenchmark'
6162
}
62-
63-
idea.module { downloadSources = downloadJavadoc = true }
64-
eclipse.classpath { downloadSources = downloadJavadoc = true }

at-mlservice/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id 'eclipse'
44
id 'idea'
55
alias libs.plugins.licenser
6+
alias libs.plugins.gradleutils
67
}
78

89
java {
@@ -29,11 +30,8 @@ dependencies {
2930
testRuntimeOnly testLibs.bundles.junit.runtime
3031
}
3132

32-
idea.module { downloadSources = downloadJavadoc = true }
33-
3433
// Hack eclipse into knowing that the gradle deps are modules
3534
eclipse.classpath {
36-
downloadSources = downloadJavadoc = true
3735
containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
3836
file.whenMerged { entries.findAll { it.kind == 'lib' || it.path == 'org.eclipse.buildship.core.gradleclasspathcontainer' }.each { it.entryAttributes['module'] = 'true' } }
3937
}

at-test-jar/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id 'idea'
44
id 'eclipse'
55
alias libs.plugins.licenser
6+
alias libs.plugins.gradleutils
67
}
78

89
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
@@ -13,11 +14,8 @@ license {
1314
exclude '**/*.properties'
1415
}
1516

16-
idea.module { downloadSources = downloadJavadoc = true }
17-
1817
// Hack eclipse into knowing that the gradle deps are modules
1918
eclipse.classpath {
20-
downloadSources = downloadJavadoc = true
2119
containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
2220
file.whenMerged { entries.findAll { it.kind == 'lib' || it.path == 'org.eclipse.buildship.core.gradleclasspathcontainer' }.each { it.entryAttributes['module'] = 'true' } }
2321
}

at-test/build.gradle

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ plugins {
33
id 'idea'
44
id 'eclipse'
55
alias libs.plugins.licenser
6+
alias libs.plugins.gradleutils
7+
alias testLibs.plugins.aggregate
68
}
79

810
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
@@ -13,6 +15,21 @@ license {
1315
exclude '**/*.properties'
1416
}
1517

18+
aggregateTesting {
19+
final bulkTests = providers.gradleProperty('bulk_tests').<boolean>map { 'true'.equalsIgnoreCase(it) }.getOrElse(false)
20+
jvms = (!bulkTests ? [ 'Adoptium': [16] ] : [
21+
'Adoptium': [16, 17, 18, 19, 20, 21],
22+
'Amazon': [16, 17, 18, 19, 20, 21],
23+
'Azul': (16..21),
24+
'BellSoft': (16..21),
25+
'GraalVM': [ 21],
26+
//'IBM': [16, 17, 18, 19, 20 ],
27+
'Microsoft': [16, 17, 21],
28+
'Oracle': (16..21),
29+
'SAP': (16..20)
30+
]) as Map<String, List<Integer>>
31+
}
32+
1633
tasks.named('test', Test) {
1734
useJUnitPlatform()
1835
reports.html.outputLocation = rootProject.layout.buildDirectory.dir('reports')
@@ -36,39 +53,3 @@ dependencies {
3653
testRuntimeOnly testLibs.bundles.junit.runtime
3754
testCompileOnly libs.nulls
3855
}
39-
40-
final testAll = tasks.register('testAll', AggregateTest) {
41-
input = file('build/test-results/')
42-
output = rootProject.file('test_results.html')
43-
}
44-
45-
def testFor(String javaVendor, int javaVersion, File output) {
46-
tasks.<Test>register("test${javaVendor}${javaVersion}", Test) {
47-
useJUnitPlatform()
48-
classpath = sourceSets.test.runtimeClasspath
49-
testClassesDirs = sourceSets.test.output.classesDirs
50-
javaLauncher = javaToolchains.launcherFor {
51-
vendor = JvmVendorSpec.of(javaVendor.toUpperCase(Locale.ROOT))
52-
languageVersion = JavaLanguageVersion.of(javaVersion)
53-
implementation = JvmImplementation.VENDOR_SPECIFIC
54-
}
55-
reports.html.outputLocation = layout.buildDirectory.dir("test-reports/${javaVendor}-${javaVersion}")
56-
reports.junitXml.outputLocation = output
57-
}
58-
}
59-
60-
(VALID_VMS as Map<String, List<Integer>>).each { javaVendor, javaVersions ->
61-
javaVersions.each { javaVersion ->
62-
def output = file("build/test-results/${javaVendor}-${javaVersion}/")
63-
output.mkdirs()
64-
def task = testFor(javaVendor, javaVersion, output)
65-
testAll.configure {
66-
inputs.dir(output)
67-
dependsOn(task)
68-
mustRunAfter(task)
69-
}
70-
}
71-
}
72-
73-
idea.module { downloadSources = downloadJavadoc = true }
74-
eclipse.classpath { downloadSources = downloadJavadoc = true }

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ plugins {
55
id 'idea'
66
id 'eclipse'
77
id 'maven-publish'
8-
//id 'io.freefair.javadoc-links'
9-
id 'com.github.ben-manes.versions'
10-
id 'net.minecraftforge.gradleutils'
8+
alias libs.plugins.versions
9+
alias libs.plugins.gradleutils
1110
alias libs.plugins.gitversion
1211
alias libs.plugins.changelog
1312
alias libs.plugins.shadow

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ org.gradle.configureondemand=true
55
org.gradle.configuration-cache=true
66
org.gradle.configuration-cache.parallel=true
77
org.gradle.configuration-cache.problems=warn
8+
org.gradle.configuration-cache.integrity-check=true
89

910
net.minecraftforge.gradleutils.publishing.use-base-archives-name=true
1011
net.minecraftforge.gradleutils.ide.automatic.sources=true
1112
net.minecraftforge.gradleutils.compilation.defaults=true
1213

1314
net.minecraftforge.gitversion.log.version=true
15+
16+
bulk_tests=true

gradle/wrapper/gradle-wrapper.jar

1.65 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)