Skip to content

Commit

Permalink
Merge pull request #53 from TheProgramSrc/feat/simplecoreapi-0.8.0
Browse files Browse the repository at this point in the history
feat: comply with SimpleCoreAPI v0.8.0
  • Loading branch information
Im-Fran committed Oct 5, 2023
2 parents fb0263a + 949ba5c commit 7f5e87f
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 123 deletions.
20 changes: 11 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ val env = project.rootProject.file(".env").let { file ->
if(file.exists()) file.readLines().filter { it.isNotBlank() && !it.startsWith("#") && it.split("=").size == 2 }.associate { it.split("=")[0] to it.split("=")[1] } else emptyMap()
}.toMutableMap().apply { putAll(System.getenv()) }

val projectVersion = env["VERSION"] ?: "0.3.0-SNAPSHOT"
val projectVersion = env["VERSION"] ?: "0.4.0-SNAPSHOT"

group = "xyz.theprogramsrc"
version = projectVersion
Expand All @@ -33,7 +33,7 @@ repositories {
}

dependencies {
compileOnly("xyz.theprogramsrc:simplecoreapi:0.6.2-SNAPSHOT")
compileOnly("xyz.theprogramsrc:simplecoreapi:0.8.0-SNAPSHOT")

implementation("me.carleslc.Simple-YAML:Simple-Yaml:1.8.4")

Expand Down Expand Up @@ -171,14 +171,16 @@ publishing {
}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
if(env["ENV"] == "prod") {
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))

username.set(env["SONATYPE_USERNAME"])
password.set(env["SONATYPE_PASSWORD"])
username.set(env["SONATYPE_USERNAME"])
password.set(env["SONATYPE_PASSWORD"])
}
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions src/main/kotlin/xyz/theprogramsrc/filesmodule/FilesModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package xyz.theprogramsrc.filesmodule

import xyz.theprogramsrc.simplecoreapi.global.models.module.Module
import xyz.theprogramsrc.simplecoreapi.global.models.module.ModuleDescription

class FilesModule: Module {

override val description: ModuleDescription =
ModuleDescription(
name = "@name@",
version = "@version@",
authors = listOf("Im-Fran")
)

override fun onDisable() {
TODO("Not yet implemented")
}

override fun onEnable() {
TODO("Not yet implemented")
}
}
5 changes: 0 additions & 5 deletions src/main/kotlin/xyz/theprogramsrc/filesmodule/Main.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package xyz.theprogramsrc.filesmodule.config

import com.google.gson.*
import xyz.theprogramsrc.filesmodule.utils.file
import xyz.theprogramsrc.simplecoreapi.global.utils.extensions.file
import java.io.File

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package xyz.theprogramsrc.filesmodule.config

import xyz.theprogramsrc.filesmodule.utils.file
import xyz.theprogramsrc.simplecoreapi.global.utils.extensions.file
import java.io.File
import java.util.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package xyz.theprogramsrc.filesmodule.config

import org.simpleyaml.configuration.ConfigurationSection
import org.simpleyaml.configuration.file.YamlConfiguration
import xyz.theprogramsrc.filesmodule.utils.file
import xyz.theprogramsrc.simplecoreapi.global.utils.extensions.file
import java.io.File

/**
Expand Down
52 changes: 0 additions & 52 deletions src/main/kotlin/xyz/theprogramsrc/filesmodule/utils/FileUtils.kt

This file was deleted.

6 changes: 0 additions & 6 deletions src/main/resources/module.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ import java.io.File

internal class JsonConfigTest {

companion object {
private val config = JsonConfig(File("test.json"))

@BeforeAll
fun setUp() {
config.destroy()
config.load()
}

@AfterAll
fun tearDown() {
config.destroy()
}

}

@Test
fun has() {
assertFalse(config.has("test"))
Expand Down Expand Up @@ -81,4 +65,22 @@ internal class JsonConfigTest {
assertEquals(3 as Number, config.getNumber("addNumber"))
config.remove("addNumber")
}

companion object {
private val config = JsonConfig(File("test.json"))

@JvmStatic
@BeforeAll
fun setUp() {
config.destroy()
config.load()
}

@JvmStatic
@AfterAll
fun tearDown() {
config.destroy()
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ import java.io.File

internal class PropertiesConfigTest {

companion object {
private val config = PropertiesConfig(File("test.properties"))

@BeforeAll
fun setUp() {
config.destroy()
config.load()
}

@AfterAll
fun tearDown() {
config.destroy()
}

}

@Test
fun has() {
assertFalse(config.has("test"))
Expand Down Expand Up @@ -56,4 +40,23 @@ internal class PropertiesConfigTest {
assertNull(config.get("test"))
assertFalse(config.has("test"))
}

companion object {
private val config = PropertiesConfig(File("test.properties"))

@JvmStatic
@BeforeAll
fun setUp() {
config.destroy()
config.load()
}

@JvmStatic
@AfterAll
fun tearDown() {
config.destroy()
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ import java.io.File

internal class YmlConfigTest {

companion object {
private val config = YmlConfig(File("test.yml"))

@BeforeAll
fun setUp() {
config.destroy()
config.load()
}

@AfterAll
fun tearDown() {
config.destroy()
}

}

@Test
fun hasAndSet() {
assertFalse(config.has("test"))
Expand Down Expand Up @@ -71,4 +55,22 @@ internal class YmlConfigTest {
assertTrue(config.has("test"))
config.remove("test")
}

companion object {
private val config = YmlConfig(File("test.yml"))

@JvmStatic
@BeforeAll
fun setUp() {
config.destroy()
config.load()
}

@JvmStatic
@AfterAll
fun tearDown() {
config.destroy()
}

}
}

0 comments on commit 7f5e87f

Please sign in to comment.