Skip to content

Commit d21a7bc

Browse files
committed
Treat warnings as errors in _ext projects.
1 parent 59819eb commit d21a7bc

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/SpotlessEclipseFramework.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 DiffPlug
2+
* Copyright 2016-2021 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.
@@ -146,6 +146,7 @@ private static <T> T createInstance(Class<? extends T> clazz) {
146146
* @throws BundleException Throws exception in case the setup failed.
147147
* @deprecated Use {@link #setup(SpotlessEclipseConfig)} instead.
148148
*/
149+
@Deprecated
149150
public synchronized static boolean setup() throws BundleException {
150151
return setup(plugins -> plugins.applyDefault());
151152
}
@@ -159,6 +160,7 @@ public synchronized static boolean setup() throws BundleException {
159160
* @throws BundleException Throws exception in case the setup failed.
160161
* @deprecated Use {@link #setup(SpotlessEclipseConfig)} instead.
161162
*/
163+
@Deprecated
162164
public synchronized static boolean setup(Consumer<SpotlessEclipsePluginConfig> plugins) throws BundleException {
163165
return setup(config -> config.applyDefault(), plugins);
164166
}
@@ -172,6 +174,7 @@ public synchronized static boolean setup(Consumer<SpotlessEclipsePluginConfig> p
172174
* @throws BundleException Throws exception in case the setup failed.
173175
* @deprecated Use {@link #setup(SpotlessEclipseConfig)} instead.
174176
*/
177+
@Deprecated
175178
public synchronized static boolean setup(Consumer<SpotlessEclipseServiceConfig> config, Consumer<SpotlessEclipsePluginConfig> plugins) throws BundleException {
176179
return setup(core -> core.applyDefault(), config, plugins);
177180
}
@@ -186,6 +189,7 @@ public synchronized static boolean setup(Consumer<SpotlessEclipseServiceConfig>
186189
* @throws BundleException Throws exception in case the setup failed.
187190
* @deprecated Use {@link #setup(SpotlessEclipseConfig)} instead.
188191
*/
192+
@Deprecated
189193
public synchronized static boolean setup(Consumer<SpotlessEclipseCoreConfig> core, Consumer<SpotlessEclipseServiceConfig> services, Consumer<SpotlessEclipsePluginConfig> plugins) throws BundleException {
190194
if (null != INSTANCE) {
191195
return false;

_ext/eclipse-jdt/src/main/java/com/diffplug/spotless/extra/eclipse/java/EclipseJdtFormatterStepImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public void activatePlugins(SpotlessEclipsePluginConfig config) {
5656
}
5757

5858
/** @deprecated Use {@link #format(String, File)} instead. */
59+
@Deprecated
5960
public String format(String raw) throws Exception {
6061
return format(raw, new File(""));
6162
}

_ext/gradle/java-setup.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ apply from: rootProject.file('gradle/java-setup.gradle')
88
// Allow declaration of api/compile dependencies
99
apply plugin: 'java-library'
1010

11-
// Show warning locations
11+
// Show warning locations, fail on warnings
1212
tasks.withType(JavaCompile) {
1313
options.compilerArgs << "-Xlint:unchecked"
1414
options.compilerArgs << "-Xlint:deprecation"
15+
options.compilerArgs << "-Werror"
1516
}
1617

1718
//Currently testlib is not used by _ext. Hence the external dependencies are added here.

0 commit comments

Comments
 (0)