Merge remote-tracking branch 'origin/166-audiomanager-opslitsen-om-single-responsibility-principle-te-volgen' into 166-audiomanager-opslitsen-om-single-responsibility-principle-te-volgen

# Conflicts:
#	framework/src/main/java/org/toop/framework/audio/MusicManager.java
This commit is contained in:
lieght
2025-10-12 20:37:23 +02:00
13 changed files with 268 additions and 77 deletions

View File

@@ -42,6 +42,18 @@
<artifactId>javafx-controls</artifactId> <artifactId>javafx-controls</artifactId>
<version>25</version> <version>25</version>
</dependency> </dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.42.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
@@ -112,14 +124,55 @@
</java> </java>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <version>3.14.1</version>
<source>25</source> <configuration>
<target>25</target> <showWarnings>true</showWarnings>
</configuration> <fork>true</fork>
</plugin> <executable>${java.home}/bin/javac</executable>
<source>25</source>
<target>25</target>
<release>25</release>
<encoding>UTF-8</encoding>
<compilerArgs>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<arg>
-Xplugin:ErrorProne \
-Xep:RestrictedApi:ERROR \
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</path>
</annotationProcessorPaths>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</dependency>
</dependencies>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@@ -7,6 +7,9 @@ import org.toop.framework.networking.NetworkingInitializationException;
import org.toop.framework.resource.ResourceLoader; import org.toop.framework.resource.ResourceLoader;
import org.toop.framework.resource.ResourceManager; import org.toop.framework.resource.ResourceManager;
import org.toop.framework.resource.resources.MusicAsset; import org.toop.framework.resource.resources.MusicAsset;
import org.toop.framework.resource.resources.SoundEffectAsset;
import java.util.Arrays;
public final class Main { public final class Main {
static void main(String[] args) { static void main(String[] args) {

View File

@@ -123,6 +123,16 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.42.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
@@ -132,11 +142,49 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version> <version>3.14.1</version>
<configuration> <configuration>
<source>25</source> <showWarnings>true</showWarnings>
<fork>true</fork>
<executable>${java.home}/bin/javac</executable>
<source>25</source>
<target>25</target> <target>25</target>
<release>25</release> <release>25</release>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
<compilerArgs>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<arg>
-Xplugin:ErrorProne \
-Xep:RestrictedApi:ERROR \
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</path>
</annotationProcessorPaths>
</configuration> </configuration>
<dependencies>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</dependency>
</dependencies>
</plugin> </plugin>
<plugin> <plugin>
<groupId>com.diffplug.spotless</groupId> <groupId>com.diffplug.spotless</groupId>

View File

@@ -6,6 +6,8 @@ import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.LoggerConfig; import org.apache.logging.log4j.core.config.LoggerConfig;
import java.util.Locale;
/** /**
* Utility class for configuring logging levels dynamically at runtime using Log4j 2. * Utility class for configuring logging levels dynamically at runtime using Log4j 2.
* *
@@ -144,7 +146,7 @@ public final class Logging {
* @param levelToLog name of the logging level (e.g., "DEBUG", "INFO") * @param levelToLog name of the logging level (e.g., "DEBUG", "INFO")
*/ */
public static void enableLogsForClass(String className, String levelToLog) { public static void enableLogsForClass(String className, String levelToLog) {
Level level = Level.valueOf(levelToLog.trim().toUpperCase()); Level level = Level.valueOf(levelToLog.trim().toUpperCase(Locale.ROOT));
if (level != null && verifyStringIsActualClass(className)) { if (level != null && verifyStringIsActualClass(className)) {
enableLogsForClassInternal(className, level); enableLogsForClassInternal(className, level);
} }

View File

@@ -0,0 +1,7 @@
package org.toop.framework.annotations;
import java.lang.annotation.*;
@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
public @interface TestsOnly {}

View File

@@ -4,6 +4,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.toop.framework.dispatch.interfaces.Dispatcher; import org.toop.framework.dispatch.interfaces.Dispatcher;
import org.toop.framework.dispatch.JavaFXDispatcher; import org.toop.framework.dispatch.JavaFXDispatcher;
import org.toop.framework.annotations.TestsOnly;
import org.toop.framework.resource.ResourceManager; import org.toop.framework.resource.ResourceManager;
import org.toop.framework.resource.resources.BaseResource; import org.toop.framework.resource.resources.BaseResource;
import org.toop.framework.resource.types.AudioResource; import org.toop.framework.resource.types.AudioResource;
@@ -13,7 +14,7 @@ import java.util.*;
public class MusicManager<T extends AudioResource> implements org.toop.framework.audio.interfaces.MusicManager<T> { public class MusicManager<T extends AudioResource> implements org.toop.framework.audio.interfaces.MusicManager<T> {
private static final Logger logger = LogManager.getLogger(MusicManager.class); private static final Logger logger = LogManager.getLogger(MusicManager.class);
private final List<T> backgroundMusic = new LinkedList<>(); private final List<T> backgroundMusic = new ArrayList<>();
private final Dispatcher dispatcher; private final Dispatcher dispatcher;
private final List<T> resources; private final List<T> resources;
private int playingIndex = 0; private int playingIndex = 0;
@@ -28,8 +29,11 @@ public class MusicManager<T extends AudioResource> implements org.toop.framework
createShuffled(); createShuffled();
} }
// Used in unit testing /**
MusicManager(List<T> resources, Dispatcher dispatcher) { * {@code @TestsOnly} DO NOT USE
*/
@TestsOnly
public MusicManager(List<T> resources, Dispatcher dispatcher) {
this.dispatcher = dispatcher; this.dispatcher = dispatcher;
this.resources = new ArrayList<>(resources); this.resources = new ArrayList<>(resources);
backgroundMusic.addAll(resources); backgroundMusic.addAll(resources);
@@ -50,6 +54,7 @@ public class MusicManager<T extends AudioResource> implements org.toop.framework
backgroundMusic.addAll(resources); backgroundMusic.addAll(resources);
} }
@Override
public void play() { public void play() {
if (playing) { if (playing) {
logger.warn("MusicManager is already playing."); logger.warn("MusicManager is already playing.");
@@ -115,6 +120,7 @@ public class MusicManager<T extends AudioResource> implements org.toop.framework
}); });
} }
@Override
public void stop() { public void stop() {
if (!playing) return; if (!playing) return;

View File

@@ -5,6 +5,7 @@ import org.apache.logging.log4j.Logger;
import org.toop.framework.resource.ResourceManager; import org.toop.framework.resource.ResourceManager;
import org.toop.framework.resource.ResourceMeta; import org.toop.framework.resource.ResourceMeta;
import org.toop.framework.resource.resources.BaseResource; import org.toop.framework.resource.resources.BaseResource;
import org.toop.framework.resource.resources.MusicAsset;
import org.toop.framework.resource.resources.SoundEffectAsset; import org.toop.framework.resource.resources.SoundEffectAsset;
import javax.sound.sampled.Clip; import javax.sound.sampled.Clip;
@@ -12,10 +13,7 @@ import javax.sound.sampled.LineEvent;
import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException; import javax.sound.sampled.UnsupportedAudioFileException;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class SoundEffectManager implements org.toop.framework.audio.interfaces.SoundEffectManager<SoundEffectAsset> { public class SoundEffectManager implements org.toop.framework.audio.interfaces.SoundEffectManager<SoundEffectAsset> {

View File

@@ -52,8 +52,11 @@ public enum VolumeControl {
FX(), FX(),
MUSIC(); MUSIC();
@SuppressWarnings("ImmutableEnumChecker")
private final List<AudioManager<? extends AudioResource>> managers = new CopyOnWriteArrayList<>(); private final List<AudioManager<? extends AudioResource>> managers = new CopyOnWriteArrayList<>();
@SuppressWarnings("ImmutableEnumChecker")
private double volume = 1.0; private double volume = 1.0;
@SuppressWarnings("ImmutableEnumChecker")
private double masterVolume = 1.0; private double masterVolume = 1.0;
/** /**

View File

@@ -9,10 +9,10 @@ public class EventsBase {
/** /**
* WIP, DO NOT USE! * WIP, DO NOT USE!
* *
* @param eventName * @param eventName todo
* @param args * @param args todo
* @return * @return todo
* @throws Exception * @throws Exception todo
*/ */
public static Object get(String eventName, Object... args) throws Exception { public static Object get(String eventName, Object... args) throws Exception {
Class<?> clazz = Class.forName("org.toop.framework.eventbus.events.Events$ServerEvents$" + eventName); Class<?> clazz = Class.forName("org.toop.framework.eventbus.events.Events$ServerEvents$" + eventName);
@@ -24,11 +24,11 @@ public class EventsBase {
/** /**
* WIP, DO NOT USE! * WIP, DO NOT USE!
* *
* @param eventCategory * @param eventCategory todo
* @param eventName * @param eventName todo
* @param args * @param args todo
* @return * @return todo
* @throws Exception * @throws Exception todo
*/ */
public static Object get(String eventCategory, String eventName, Object... args) public static Object get(String eventCategory, String eventName, Object... args)
throws Exception { throws Exception {
@@ -42,10 +42,10 @@ public class EventsBase {
/** /**
* WIP, DO NOT USE! * WIP, DO NOT USE!
* *
* @param eventName * @param eventName todo
* @param args * @param args todo
* @return * @return todo
* @throws Exception * @throws Exception todo
*/ */
public static Object get2(String eventName, Object... args) throws Exception { public static Object get2(String eventName, Object... args) throws Exception {
// Fully qualified class name // Fully qualified class name

View File

@@ -119,6 +119,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
} }
private void gameWinConditionHandler(String rec) { private void gameWinConditionHandler(String rec) {
@SuppressWarnings("StreamToString")
String condition = String condition =
Pattern.compile("\\b(win|draw|lose)\\b", Pattern.CASE_INSENSITIVE) Pattern.compile("\\b(win|draw|lose)\\b", Pattern.CASE_INSENSITIVE)
.matcher(rec) .matcher(rec)
@@ -180,6 +181,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
} }
private void gameYourTurnHandler(String rec) { private void gameYourTurnHandler(String rec) {
@SuppressWarnings("StreamToString")
String msg = String msg =
Pattern.compile("TURNMESSAGE:\\s*\"([^\"]*)\"") Pattern.compile("TURNMESSAGE:\\s*\"([^\"]*)\"")
.matcher(rec) .matcher(rec)

View File

@@ -32,7 +32,7 @@ public class LocalizationAsset extends BaseResource implements LoadableResource,
private final Map<Locale, ResourceBundle> bundles = new HashMap<>(); private final Map<Locale, ResourceBundle> bundles = new HashMap<>();
/** Flag indicating whether this asset has been loaded. */ /** Flag indicating whether this asset has been loaded. */
private boolean isLoaded = false; private boolean loaded = false;
/** Basename of the given asset */ /** Basename of the given asset */
private final String baseName = "localization"; private final String baseName = "localization";
@@ -53,14 +53,14 @@ public class LocalizationAsset extends BaseResource implements LoadableResource,
@Override @Override
public void load() { public void load() {
loadFile(getFile()); loadFile(getFile());
isLoaded = true; loaded = true;
} }
/** Unloads all loaded resource bundles, freeing memory. */ /** Unloads all loaded resource bundles, freeing memory. */
@Override @Override
public void unload() { public void unload() {
bundles.clear(); bundles.clear();
isLoaded = false; loaded = false;
} }
/** /**
@@ -70,7 +70,7 @@ public class LocalizationAsset extends BaseResource implements LoadableResource,
*/ */
@Override @Override
public boolean isLoaded() { public boolean isLoaded() {
return isLoaded; return loaded;
} }
/** /**
@@ -131,7 +131,7 @@ public class LocalizationAsset extends BaseResource implements LoadableResource,
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException("Failed to load localization file: " + file, e); throw new RuntimeException("Failed to load localization file: " + file, e);
} }
isLoaded = true; loaded = true;
} }
/** /**

View File

@@ -83,39 +83,71 @@
<artifactId>slf4j-simple</artifactId> <artifactId>slf4j-simple</artifactId>
<version>2.0.17</version> <version>2.0.17</version>
</dependency> </dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.42.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version> <version>3.14.1</version>
<configuration> <configuration>
<source>25</source> <showWarnings>true</showWarnings>
<target>25</target> <fork>true</fork>
<release>25</release> <executable>${java.home}/bin/javac</executable>
<encoding>UTF-8</encoding> <source>25</source>
<!-- <compilerArgs>--> <target>25</target>
<!-- <arg>-XDcompilePolicy=simple</arg>--> <release>25</release>
<!-- <arg>&#45;&#45;should-stop=ifError=FLOW</arg>--> <encoding>UTF-8</encoding>
<!-- <arg>-Xplugin:ErrorProne</arg>--> <compilerArgs>
<!-- </compilerArgs>--> <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<!-- <annotationProcessorPaths>--> <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<!-- <path>--> <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<!-- <groupId>com.google.errorprone</groupId>--> <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<!-- <artifactId>error_prone_core</artifactId>--> <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<!-- <version>2.42.0</version>--> <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<!-- </path>--> <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<!-- &lt;!&ndash; Other annotation processors go here.--> <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<!-- If 'annotationProcessorPaths' is set, processors will no longer be--> <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<!-- discovered on the regular -classpath; see also 'Using Error Prone--> <arg>
<!-- together with other annotation processors' below. &ndash;&gt;--> -Xplugin:ErrorProne \
<!-- </annotationProcessorPaths>--> -Xep:RestrictedApi:ERROR \
<!-- <fork>true</fork>--> -XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
</configuration> -XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
</plugin> -XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</path>
</annotationProcessorPaths>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</dependency>
</dependencies>
</plugin>
<plugin> <plugin>
<groupId>com.diffplug.spotless</groupId> <groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId> <artifactId>spotless-maven-plugin</artifactId>

61
pom.xml
View File

@@ -107,18 +107,55 @@
</java> </java>
</configuration> </configuration>
</plugin> </plugin>
<!-- <plugin>--> <plugin>
<!-- <groupId>org.apache.maven.plugins</groupId>--> <groupId>org.apache.maven.plugins</groupId>
<!-- <artifactId>maven-compiler-plugin</artifactId>--> <artifactId>maven-compiler-plugin</artifactId>
<!-- <version>3.14.1</version>--> <version>3.14.1</version>
<!-- <configuration>--> <configuration>
<!-- <outputDirectory>${project.build.directory}/custom</outputDirectory>--> <showWarnings>true</showWarnings>
<!-- <source>25</source>--> <fork>true</fork>
<!-- <target>25</target>--> <executable>${java.home}/bin/javac</executable>
<!-- <release>25</release>--> <source>25</source>
<!-- <encoding>UTF-8</encoding>--> <target>25</target>
<!-- </configuration>--> <release>25</release>
<!-- </plugin>--> <encoding>UTF-8</encoding>
<compilerArgs>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
<arg>
-Xplugin:ErrorProne \
-Xep:RestrictedApi:ERROR \
-XepOpt:RestrictedApi:annotation=org.toop.framework.annotations.TestsOnly \
-XepOpt:RestrictedApi:allowlistRegex=(?s).*/src/test/java/.*|.*test\.java \
-XepOpt:RestrictedApi:message=This API is marked @TestsOnly and shouldn't be normally used.
</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</path>
</annotationProcessorPaths>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.42.0</version>
</dependency>
</dependencies>
</plugin>
</plugins> </plugins>
</build> </build>