Skip to content

Commit c9d24e0

Browse files
robert3005bulldozer-bot[bot]
authored andcommitted
Break: Add gradle 6.0-20190904072820+0000 compatibility. Compile with -Werror and -Xlint:deprecation (#791)
Add gradle 6.0-20190904072820+0000 compatibility. This raises minimum required version of gradle for plugins from this repo to 5.0. Additionally add '-Werror' and '-Xlint:deprecation' so we can detect compatibility issues early
1 parent ab5a0a2 commit c9d24e0

File tree

10 files changed

+18
-8
lines changed

10 files changed

+18
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ See also the [Baseline Java Style Guide and Best Practises](./docs).
2929

3030

3131
## Usage
32-
The baseline set of plugins requires at least Gradle 4.10.0.
32+
The baseline set of plugins requires at least Gradle 5.0.
3333

3434
It is recommended to add `apply plugin: 'com.palantir.baseline'` to your root project's build.gradle. Individual plugins will be automatically applied to appropriate subprojects.
3535

baseline-refaster-javac-plugin/src/main/java/com/palantir/baseline/refaster/BaselineRefasterCompiler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public String getName() {
3737
}
3838

3939
@Override
40+
@SuppressWarnings("PreferSafeLoggingPreconditions")
4041
public void init(JavacTask task, String... args) {
4142
List<String> listArgs = Arrays.asList(args);
4243
int outIndex = listArgs.indexOf("--out");

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ allprojects {
4545

4646
pluginManager.withPlugin('java') {
4747
sourceCompatibility = 1.8
48+
tasks.withType(JavaCompile) {
49+
options.compilerArgs += ['-Werror', '-Xlint:deprecation']
50+
}
4851
}
4952

5053
apply plugin: 'org.inferred.processors'

changelog/@unreleased/pr-791.v2.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type: break
2+
break:
3+
description: Add gradle 6.0-20190904072820+0000 compatibiltiy. This raises minimum required version of gradle for plugins from this repo to 5.0. Additionally add '-Werror' and '-Xlint:deprecation' so we can detect compatiblilty issues early
4+
links:
5+
- https://github.com/palantir/gradle-baseline/pull/791

gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/versions/CheckBomConflictTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
public class CheckBomConflictTask extends DefaultTask {
4444

4545
private final Property<Boolean> shouldFix = getProject().getObjects().property(Boolean.class);
46-
private final RegularFileProperty propsFileProperty = newInputFile();
46+
private final RegularFileProperty propsFileProperty = getProject().getObjects().fileProperty();
4747

4848
public CheckBomConflictTask() {
4949
shouldFix.set(false);

gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/versions/CheckNoUnusedPinTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
public class CheckNoUnusedPinTask extends DefaultTask {
4343

4444
private final Property<Boolean> shouldFix = getProject().getObjects().property(Boolean.class);
45-
private final RegularFileProperty propsFileProperty = newInputFile();
45+
private final RegularFileProperty propsFileProperty = getProject().getObjects().fileProperty();
4646

4747
public CheckNoUnusedPinTask() {
4848
shouldFix.set(false);

gradle-baseline-java/src/test/groovy/com/palantir/baseline/BaselineIntegrationTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ class BaselineIntegrationTest extends AbstractPluginTest {
4343
with().withArguments('-s').withGradleVersion(gradleVersion).build()
4444

4545
where:
46-
gradleVersion << ['4.10.2', '5.0-milestone-1']
46+
gradleVersion << ['5.0', '6.0-20190904072820+0000']
4747
}
4848
}

gradle-junit-reports/src/main/java/com/palantir/gradle/junit/JunitReportsExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class JunitReportsExtension {
2424
private final DirectoryProperty reportsDirectory;
2525

2626
public JunitReportsExtension(Project project) {
27-
this.reportsDirectory = project.getLayout().directoryProperty();
27+
this.reportsDirectory = project.getObjects().directoryProperty();
2828
reportsDirectory.set(project.getLayout().getBuildDirectory().dir("junit-reports"));
2929
}
3030

gradle-junit-reports/src/main/java/com/palantir/gradle/junit/JunitReportsFinalizer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public static void registerFinalizer(
6060
private Task styleTask;
6161
private TaskTimer taskTimer;
6262
private FailuresSupplier failuresSupplier;
63-
private final RegularFileProperty targetFile = getProject().getLayout().fileProperty();
64-
private final DirectoryProperty reportDir = getProject().getLayout().directoryProperty();
63+
private final RegularFileProperty targetFile = getProject().getObjects().fileProperty();
64+
private final DirectoryProperty reportDir = getProject().getObjects().directoryProperty();
6565

6666
@Inject
6767
public JunitReportsFinalizer() { }

gradle-junit-reports/src/main/java/com/palantir/gradle/junit/JunitReportsPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public final class JunitReportsPlugin implements Plugin<Project> {
3434
public static final String EXT_JUNIT_REPORTS = "junitReports";
3535

3636
@Override
37+
@SuppressWarnings("Slf4jLogsafeArgs")
3738
public void apply(Project project) {
3839
if (project != project.getRootProject()) {
3940
project.getLogger().warn(
@@ -82,7 +83,7 @@ private static void configureBuildFailureFinalizer(Project rootProject, Provider
8283
int attemptNumber = 1;
8384
Path targetFile = dir.getAsFile().toPath().resolve("gradle").resolve("build.xml");
8485
while (targetFile.toFile().exists()) {
85-
targetFile = dir.getAsFile().toPath().resolve("gradle").resolve("build" + (++attemptNumber) + ".xml");
86+
targetFile = dir.getAsFile().toPath().resolve("gradle").resolve("build" + ++attemptNumber + ".xml");
8687
}
8788
return dir.file(targetFile.toAbsolutePath().toString());
8889
});

0 commit comments

Comments
 (0)