diff --git a/base/src/main/java/de/staropensource/sosengine/base/Engine.java b/base/src/main/java/de/staropensource/sosengine/base/Engine.java index d55f4cc0..6587e14b 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/Engine.java +++ b/base/src/main/java/de/staropensource/sosengine/base/Engine.java @@ -134,6 +134,7 @@ public final class Engine implements SubsystemMainClass { crashContentEngineDependencies.put("Lombok", "%engine_dependency_lombok%"); crashContentEngineDependencies.put("Jetbrains Annotations", "%engine_dependency_jetbrains_annotations%"); crashContentEngineDependencies.put("Jansi", "%engine_dependency_jansi%"); + crashContentEngineDependencies.put("Reflections", "%engine_dependencies_reflections%"); // Engine -> Plugins Map crashContentEnginePlugins = new LinkedHashMap<>(); crashContentEnginePlugins.put("Shadow", "%engine_plugin_shadow%"); diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/info/EngineInformation.java b/base/src/main/java/de/staropensource/sosengine/base/data/info/EngineInformation.java index 1613d289..f04f5eeb 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/info/EngineInformation.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/info/EngineInformation.java @@ -144,6 +144,21 @@ public final class EngineInformation { */ private String dependencyJansi; + /** + * Provides the version of the dependency {@code Reflections}. + * + * @since 1-alpha0 + * + * -- GETTER -- + * Provides the version of the dependency {@code Reflections}. + * + * @return Reflections dependency version + * @since 1-alpha0 + */ + private String dependencyReflections; + + /** + /** * Provides the version of the Gradle plugin {@code Shadow}. * @@ -215,6 +230,7 @@ public final class EngineInformation { dependencyLombok = parser.getString("dependencyLombok"); dependencyJetbrainsAnnotations = parser.getString("dependencyJetbrainsAnnotations"); dependencyJansi = parser.getString("dependencyJansi"); + dependencyReflections = parser.getString("dependencyReflections"); pluginShadow = parser.getString("pluginShadow"); pluginLombok = parser.getString("pluginLombok"); diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/placeholders/EngineDependencyReflections.java b/base/src/main/java/de/staropensource/sosengine/base/data/placeholders/EngineDependencyReflections.java new file mode 100644 index 00000000..ad0077dd --- /dev/null +++ b/base/src/main/java/de/staropensource/sosengine/base/data/placeholders/EngineDependencyReflections.java @@ -0,0 +1,53 @@ +/* + * STAROPENSOURCE ENGINE SOURCE FILE + * Copyright (c) 2024 The StarOpenSource Engine Contributors + * Licensed under the GNU Affero General Public License v3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.staropensource.sosengine.base.data.placeholders; + +import de.staropensource.sosengine.base.classes.Placeholder; +import de.staropensource.sosengine.base.data.info.EngineInformation; +import org.jetbrains.annotations.NotNull; + +/** + * Implements the {@code engine_dependency_reflections} placeholder. + * + * @see Placeholder + * @since 1-alpha0 + */ +@SuppressWarnings({ "unused" }) +public final class EngineDependencyReflections implements Placeholder { + /** + * Constructor. + * + * @since 1-alpha0 + */ + public EngineDependencyReflections() {} + + /** {@inheritDoc} */ + @NotNull + public String getName() { + return "engine_dependency_reflections"; + } + + /** {@inheritDoc} */ + @NotNull + @Override + public String replace(@NotNull String text) { + return text.replace("%" + getName() + "%", EngineInformation.getInstance().getDependencyReflections()); + } +} diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/PlaceholderEngine.java b/base/src/main/java/de/staropensource/sosengine/base/utility/PlaceholderEngine.java index 108f01d3..a6632c99 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/PlaceholderEngine.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/PlaceholderEngine.java @@ -91,6 +91,7 @@ public final class PlaceholderEngine { placeholders.add(new EngineDependencyLombok()); placeholders.add(new EngineDependencyJetbrainsAnnotations()); placeholders.add(new EngineDependencyJansi()); + placeholders.add(new EngineDependencyReflections()); // engine_plugin_* placeholders.add(new EnginePluginLombok()); placeholders.add(new EnginePluginShadow());