Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ plugins {

group = "dev.faststats.metrics"

val libs = rootProject.the<VersionCatalogsExtension>().named("libs")

repositories {
mavenCentral()
}
Expand All @@ -31,6 +33,12 @@ sourceSets.main {
resources.srcDir(generateFastStatsProperties)
}

dependencies {
testImplementation(platform(libs.findLibrary("junit-bom").get()))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.test {
dependsOn(tasks.javadoc)
useJUnitPlatform()
Expand Down
6 changes: 3 additions & 3 deletions bukkit/src/main/java/dev/faststats/bukkit/BukkitContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import dev.faststats.SimpleContext;
import dev.faststats.Token;
import dev.faststats.config.SimpleConfig;
import dev.faststats.config.CustomConfig;
import dev.faststats.internal.LoggerFactory;
import dev.faststats.internal.PlatformLoggerFactory;
import org.bukkit.plugin.Plugin;
Expand All @@ -23,7 +23,7 @@ public final class BukkitContext extends SimpleContext {
private final Plugin plugin;

private BukkitContext(final Factory factory, final LoggerFactory loggerFactory, final Plugin plugin, @Token final String token) {
super(factory, loggerFactory, SimpleConfig.read(getConfigPath(plugin), loggerFactory), "bukkit", token);
super(factory, loggerFactory, CustomConfig.builder(getConfigPath(plugin), loggerFactory).build(), "bukkit", token);
this.plugin = plugin;
initializeServices(factory);
}
Expand Down Expand Up @@ -60,7 +60,7 @@ private static Path getPluginsFolder(final Plugin plugin) {

@Override
protected boolean preSubmissionStart() {
return ((SimpleConfig) getConfig()).preSubmissionStart(this);
return ((CustomConfig) getConfig()).preSubmissionStart(this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import dev.faststats.SimpleContext;
import dev.faststats.SimpleMetrics;
import dev.faststats.Token;
import dev.faststats.config.SimpleConfig;
import dev.faststats.config.CustomConfig;
import dev.faststats.internal.LoggerFactory;
import dev.faststats.internal.PlatformLoggerFactory;
import net.md_5.bungee.api.plugin.Plugin;
Expand All @@ -25,9 +25,9 @@ public final class BungeeContext extends SimpleContext {
private final Plugin plugin;

private BungeeContext(final Factory factory, final LoggerFactory loggerFactory, final Plugin plugin, @Token final String token) {
super(factory, loggerFactory, SimpleConfig.read(plugin.getProxy().getPluginsFolder().toPath()
super(factory, loggerFactory, CustomConfig.builder(plugin.getProxy().getPluginsFolder().toPath()
.resolve("faststats").resolve("config.properties"), loggerFactory
), "bungeecord", token);
).build(), "bungeecord", token);
this.plugin = plugin;
initializeServices(factory);
}
Expand All @@ -45,7 +45,7 @@ public Metrics create() throws IllegalStateException {

@Override
protected boolean preSubmissionStart() {
return ((SimpleConfig) getConfig()).preSubmissionStart(this);
return ((CustomConfig) getConfig()).preSubmissionStart(this);
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ tasks.compileJava {

dependencies {
compileOnly(project(":core"))

testImplementation(project(":core"))
}
Loading