File tree Expand file tree Collapse file tree 4 files changed +7
-47
lines changed
plugin-gradle/src/main/java/com/diffplug/gradle/spotless Expand file tree Collapse file tree 4 files changed +7
-47
lines changed Original file line number Diff line number Diff line change @@ -635,7 +635,8 @@ public LicenseHeaderConfig updateYearWithLatest(boolean updateYearWithLatest) {
635635
636636 FormatterStep createStep () {
637637 return builder .withYearModeLazy (() -> {
638- if (Boolean .parseBoolean (GradleCompat .findOptionalProperty (spotless .project , LicenseHeaderStep .FLAG_SET_LICENSE_HEADER_YEARS_FROM_GIT_HISTORY ()))) {
638+ String yearProperty = spotless .project .getProviders ().gradleProperty (LicenseHeaderStep .FLAG_SET_LICENSE_HEADER_YEARS_FROM_GIT_HISTORY ()).getOrNull ();
639+ if (Boolean .parseBoolean (yearProperty )) {
639640 return YearMode .SET_FROM_GIT ;
640641 } else {
641642 boolean updateYear = updateYearWithLatest == null ? getRatchetFrom () != null : updateYearWithLatest ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -39,10 +39,10 @@ static class State extends NoLambda.EqualityBasedOnSerialization {
3939 final boolean useStdOut ;
4040
4141 State (Project project ) {
42- var pathsString = GradleCompat . findOptionalProperty ( project , PROPERTY );
42+ var pathsString = project . getProviders (). gradleProperty ( PROPERTY ). getOrNull ( );
4343 if (pathsString != null ) {
44- useStdIn = GradleCompat . isPropertyPresent ( project , USE_STD_IN );
45- useStdOut = GradleCompat . isPropertyPresent ( project , USE_STD_OUT );
44+ useStdIn = project . getProviders (). gradleProperty ( USE_STD_IN ). isPresent ( );
45+ useStdOut = project . getProviders (). gradleProperty ( USE_STD_OUT ). isPresent ( );
4646 paths = Arrays .stream (pathsString .split ("," ))
4747 .map (String ::trim )
4848 .filter (s -> !s .isEmpty ())
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2016-2025 DiffPlug
2+ * Copyright 2016-2026 DiffPlug
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ public void apply(Project project) {
4242 + "https://docs.gradle.org/current/userguide/building_java_projects.html#sec:java_cross_compilation" );
4343 }
4444 // if -PspotlessModern=true, then use the modern stuff instead of the legacy stuff
45- if (GradleCompat . isPropertyPresent ( project , SPOTLESS_MODERN )) {
45+ if (project . getProviders (). gradleProperty ( SPOTLESS_MODERN ). isPresent ( )) {
4646 project .getLogger ().warn ("'spotlessModern' has no effect as of Spotless 5.0, recommend removing it." );
4747 }
4848 // make sure there's a `clean` and a `check`
You can’t perform that action at this time.
0 commit comments