diff --git a/build.gradle b/build.gradle index 29994e84..0e657d97 100644 --- a/build.gradle +++ b/build.gradle @@ -52,6 +52,8 @@ subprojects { includeGroup 'github.scarsz' includeGroup 'me.scarsz' includeGroup 'me.minecraftauth' + + includeGroup 'org.spongepowered' // Configurate yamlbranch } } maven { diff --git a/common/build.gradle b/common/build.gradle index 634e9b1a..1998f159 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -65,7 +65,6 @@ dependencies { // Config runtimeDownloadApi(libs.configurate.yaml) - runtimeDownloadApi(libs.configurate.hocon) // Logging compileOnly(libs.log4j.core) diff --git a/common/src/main/java/com/discordsrv/common/config/manager/loader/HoconConfigLoaderProvider.java b/common/src/main/java/com/discordsrv/common/config/manager/loader/HoconConfigLoaderProvider.java deleted file mode 100644 index a6f1db20..00000000 --- a/common/src/main/java/com/discordsrv/common/config/manager/loader/HoconConfigLoaderProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of DiscordSRV, licensed under the GPLv3 License - * Copyright (c) 2016-2023 Austin "Scarsz" Shapiro, Henri "Vankka" Schubin and DiscordSRV contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.discordsrv.common.config.manager.loader; - -import org.jetbrains.annotations.ApiStatus; -import org.spongepowered.configurate.hocon.HoconConfigurationLoader; -import org.spongepowered.configurate.loader.AbstractConfigurationLoader; - -public interface HoconConfigLoaderProvider extends ConfigLoaderProvider { - - @Override - @ApiStatus.NonExtendable - default AbstractConfigurationLoader.Builder createBuilder() { - return HoconConfigurationLoader.builder() - .prettyPrinting(true); - } -} diff --git a/common/src/main/java/com/discordsrv/common/config/manager/loader/YamlConfigLoaderProvider.java b/common/src/main/java/com/discordsrv/common/config/manager/loader/YamlConfigLoaderProvider.java index c392dd04..5802ed62 100644 --- a/common/src/main/java/com/discordsrv/common/config/manager/loader/YamlConfigLoaderProvider.java +++ b/common/src/main/java/com/discordsrv/common/config/manager/loader/YamlConfigLoaderProvider.java @@ -22,6 +22,9 @@ import org.jetbrains.annotations.ApiStatus; import org.spongepowered.configurate.loader.AbstractConfigurationLoader; import org.spongepowered.configurate.yaml.NodeStyle; import org.spongepowered.configurate.yaml.YamlConfigurationLoader; +import org.spongepowered.configurate.yaml.internal.snakeyaml.DumperOptions; + +import java.lang.reflect.Field; public interface YamlConfigLoaderProvider extends ConfigLoaderProvider { @@ -36,8 +39,21 @@ public interface YamlConfigLoaderProvider extends ConfigLoaderProvider createBuilder() { - return YamlConfigurationLoader.builder() + YamlConfigurationLoader.Builder builder = YamlConfigurationLoader.builder() + .commentsEnabled(true) .nodeStyle(nodeStyle()) .indent(indent()); + + try { + Field field = builder.getClass().getDeclaredField("options"); + field.setAccessible(true); + + DumperOptions dumperOptions = (DumperOptions) field.get(builder); + dumperOptions.setSplitLines(false); + } catch (ReflectiveOperationException e) { + e.printStackTrace(); + } + + return builder; } } diff --git a/i18n/build.gradle b/i18n/build.gradle index 9f09ed67..033c2703 100644 --- a/i18n/build.gradle +++ b/i18n/build.gradle @@ -21,7 +21,6 @@ dependencies { implementation(project(':velocity')) { transitive = false } api(libs.configurate.yaml) - api(libs.configurate.hocon) } application { diff --git a/settings.gradle b/settings.gradle index 8c7cc1fb..40a7bd20 100644 --- a/settings.gradle +++ b/settings.gradle @@ -82,9 +82,8 @@ dependencyResolutionManagement { library('jackson-databind', 'com.fasterxml.jackson.core', 'jackson-databind').version('2.14.2') // Config(urate) - version('configurate', '4.1.2') + version('configurate', '4.2.0-yamlbranch-4') library('configurate-yaml', 'org.spongepowered', 'configurate-yaml').versionRef('configurate') - library('configurate-hocon', 'org.spongepowered', 'configurate-hocon').versionRef('configurate') // DB library('hikaricp', 'com.zaxxer', 'HikariCP').version { diff --git a/sponge/build.gradle b/sponge/build.gradle index d9a393e1..e1c405d3 100644 --- a/sponge/build.gradle +++ b/sponge/build.gradle @@ -8,14 +8,14 @@ shadowJar { allprojects { repositories { - exclusiveContent { - forRepository { +// exclusiveContent { +// forRepository { maven { url 'https://repo.spongepowered.org/maven/' } - } - filter { - includeGroup 'org.spongepowered' - } - } +// } +// filter { +// includeGroup 'org.spongepowered' +// } +// } } dependencies {