-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Gradle 6.6 #153
Comments
Blocked by gradle/gradle#13614 |
gradle 6.6 released, and with the new
Looks like a trivial fix. Have to lookup the overrides specifically rather than searching for them like today in getOverrides. |
Trying to fix (wild guesses here, never done any plugin development - nor groovy) that part results in the following error on the second execution after establishing the cache:
Crude diff to get rid of the undeclared_sys_prop_read warning:diff --git a/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerExtension.groovy b/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerExtension.groovy
index e46768e..2a71e06 100644
--- a/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerExtension.groovy
+++ b/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerExtension.groovy
@@ -3,6 +3,7 @@ package com.adarshr.gradle.testlogger
import com.adarshr.gradle.testlogger.theme.ThemeType
import groovy.transform.CompileStatic
import org.gradle.api.logging.LogLevel
+import org.gradle.api.provider.ProviderFactory
import org.gradle.api.tasks.testing.logging.TestLogging
import static com.adarshr.gradle.testlogger.theme.ThemeType.STANDARD
@@ -185,31 +186,35 @@ class TestLoggerExtension {
this
}
- TestLoggerExtension applyOverrides(Map<String, String> overrides) {
- override(overrides, 'theme', ThemeType)
- override(overrides, 'showExceptions', Boolean)
- override(overrides, 'showCauses', Boolean)
- override(overrides, 'showStackTraces', Boolean)
- override(overrides, 'showFullStackTraces', Boolean)
- override(overrides, 'slowThreshold', Long)
- override(overrides, 'showSummary', Boolean)
- override(overrides, 'showStandardStreams', Boolean)
- override(overrides, 'showPassedStandardStreams', Boolean)
- override(overrides, 'showSkippedStandardStreams', Boolean)
- override(overrides, 'showFailedStandardStreams', Boolean)
- override(overrides, 'showPassed', Boolean)
- override(overrides, 'showSkipped', Boolean)
- override(overrides, 'showFailed', Boolean)
- override(overrides, 'showSimpleNames', Boolean)
+ TestLoggerExtension applyOverrides(ProviderFactory providers) {
+ override(providers, 'theme', ThemeType)
+ override(providers, 'showExceptions', Boolean)
+ override(providers, 'showCauses', Boolean)
+ override(providers, 'showStackTraces', Boolean)
+ override(providers, 'showFullStackTraces', Boolean)
+ override(providers, 'slowThreshold', Long)
+ override(providers, 'showSummary', Boolean)
+ override(providers, 'showStandardStreams', Boolean)
+ override(providers, 'showPassedStandardStreams', Boolean)
+ override(providers, 'showSkippedStandardStreams', Boolean)
+ override(providers, 'showFailedStandardStreams', Boolean)
+ override(providers, 'showPassed', Boolean)
+ override(providers, 'showSkipped', Boolean)
+ override(providers, 'showFailed', Boolean)
+ override(providers, 'showSimpleNames', Boolean)
this
}
- private void override(Map<String, String> overrides, String name, Class type) {
- if (overrides.containsKey(name)) {
+ private void override(ProviderFactory providers, String name, Class type) {
+ def property = providers
+ .systemProperty("${TestLoggerPlugin.EXTENSION_NAME}.${name}" as String)
+ .forUseAtConfigurationTime()
+
+ if (property.isPresent()) {
String method = Enum.isAssignableFrom(type) ? 'fromName' : 'valueOf'
- setProperty(name, type.invokeMethod(method, overrides[name]))
+ setProperty(name, type.invokeMethod(method, property.get()))
}
}
}
diff --git a/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerPlugin.groovy b/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerPlugin.groovy
index 9faba2e..674dee5 100644
--- a/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerPlugin.groovy
+++ b/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerPlugin.groovy
@@ -9,7 +9,7 @@ import org.gradle.api.tasks.testing.Test
@CompileStatic
class TestLoggerPlugin implements Plugin<Project> {
- private static final String EXTENSION_NAME = 'testlogger'
+ public static final String EXTENSION_NAME = 'testlogger'
@Override
void apply(Project project) {
@@ -44,14 +44,6 @@ class TestLoggerPlugin implements Plugin<Project> {
.undecorate()
.reactTo(test.testLogging)
.combine(projectExtension)
- .applyOverrides(overrides)
- }
-
- private static Map<String, String> getOverrides() {
- (System.properties as Map<String, String>).findAll { key, value ->
- key.startsWith "${EXTENSION_NAME}."
- }.collectEntries { key, value ->
- [(key.replace("${EXTENSION_NAME}.", '')): value]
- } as Map<String, String>
+ .applyOverrides(test.project.providers)
}
} ...and commenting out jacoco, build scans, and the overrides test, and bumping to 6.6 |
Description
Upgrade to Gradle 6.6
The text was updated successfully, but these errors were encountered: