Add EngineInformation#dependencyReflections & more
This commit is contained in:
parent
8590956382
commit
00268e4307
4 changed files with 71 additions and 0 deletions
|
@ -134,6 +134,7 @@ public final class Engine implements SubsystemMainClass {
|
||||||
crashContentEngineDependencies.put("Lombok", "%engine_dependency_lombok%");
|
crashContentEngineDependencies.put("Lombok", "%engine_dependency_lombok%");
|
||||||
crashContentEngineDependencies.put("Jetbrains Annotations", "%engine_dependency_jetbrains_annotations%");
|
crashContentEngineDependencies.put("Jetbrains Annotations", "%engine_dependency_jetbrains_annotations%");
|
||||||
crashContentEngineDependencies.put("Jansi", "%engine_dependency_jansi%");
|
crashContentEngineDependencies.put("Jansi", "%engine_dependency_jansi%");
|
||||||
|
crashContentEngineDependencies.put("Reflections", "%engine_dependencies_reflections%");
|
||||||
// Engine -> Plugins
|
// Engine -> Plugins
|
||||||
Map<String, String> crashContentEnginePlugins = new LinkedHashMap<>();
|
Map<String, String> crashContentEnginePlugins = new LinkedHashMap<>();
|
||||||
crashContentEnginePlugins.put("Shadow", "%engine_plugin_shadow%");
|
crashContentEnginePlugins.put("Shadow", "%engine_plugin_shadow%");
|
||||||
|
|
|
@ -144,6 +144,21 @@ public final class EngineInformation {
|
||||||
*/
|
*/
|
||||||
private String dependencyJansi;
|
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}.
|
* Provides the version of the Gradle plugin {@code Shadow}.
|
||||||
*
|
*
|
||||||
|
@ -215,6 +230,7 @@ public final class EngineInformation {
|
||||||
dependencyLombok = parser.getString("dependencyLombok");
|
dependencyLombok = parser.getString("dependencyLombok");
|
||||||
dependencyJetbrainsAnnotations = parser.getString("dependencyJetbrainsAnnotations");
|
dependencyJetbrainsAnnotations = parser.getString("dependencyJetbrainsAnnotations");
|
||||||
dependencyJansi = parser.getString("dependencyJansi");
|
dependencyJansi = parser.getString("dependencyJansi");
|
||||||
|
dependencyReflections = parser.getString("dependencyReflections");
|
||||||
|
|
||||||
pluginShadow = parser.getString("pluginShadow");
|
pluginShadow = parser.getString("pluginShadow");
|
||||||
pluginLombok = parser.getString("pluginLombok");
|
pluginLombok = parser.getString("pluginLombok");
|
||||||
|
|
|
@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
|
@ -91,6 +91,7 @@ public final class PlaceholderEngine {
|
||||||
placeholders.add(new EngineDependencyLombok());
|
placeholders.add(new EngineDependencyLombok());
|
||||||
placeholders.add(new EngineDependencyJetbrainsAnnotations());
|
placeholders.add(new EngineDependencyJetbrainsAnnotations());
|
||||||
placeholders.add(new EngineDependencyJansi());
|
placeholders.add(new EngineDependencyJansi());
|
||||||
|
placeholders.add(new EngineDependencyReflections());
|
||||||
// engine_plugin_*
|
// engine_plugin_*
|
||||||
placeholders.add(new EnginePluginLombok());
|
placeholders.add(new EnginePluginLombok());
|
||||||
placeholders.add(new EnginePluginShadow());
|
placeholders.add(new EnginePluginShadow());
|
||||||
|
|
Loading…
Reference in a new issue