File tree 11 files changed +91
-123
lines changed
kotlin/xyz/theprogramsrc/filesmodule
test/kotlin/xyz/theprogramsrc/filesmodule/config
11 files changed +91
-123
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ val env = project.rootProject.file(".env").let { file ->
15
15
if (file.exists()) file.readLines().filter { it.isNotBlank() && ! it.startsWith(" #" ) && it.split(" =" ).size == 2 }.associate { it.split(" =" )[0 ] to it.split(" =" )[1 ] } else emptyMap()
16
16
}.toMutableMap().apply { putAll(System .getenv()) }
17
17
18
- val projectVersion = env[" VERSION" ] ? : " 0.3 .0-SNAPSHOT"
18
+ val projectVersion = env[" VERSION" ] ? : " 0.4 .0-SNAPSHOT"
19
19
20
20
group = " xyz.theprogramsrc"
21
21
version = projectVersion
@@ -33,7 +33,7 @@ repositories {
33
33
}
34
34
35
35
dependencies {
36
- compileOnly(" xyz.theprogramsrc:simplecoreapi:0.6.2 -SNAPSHOT" )
36
+ compileOnly(" xyz.theprogramsrc:simplecoreapi:0.8.0 -SNAPSHOT" )
37
37
38
38
implementation(" me.carleslc.Simple-YAML:Simple-Yaml:1.8.4" )
39
39
@@ -171,14 +171,16 @@ publishing {
171
171
}
172
172
}
173
173
174
- nexusPublishing {
175
- repositories {
176
- sonatype {
177
- nexusUrl.set(uri(" https://s01.oss.sonatype.org/service/local/" ))
178
- snapshotRepositoryUrl.set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
174
+ if (env[" ENV" ] == " prod" ) {
175
+ nexusPublishing {
176
+ repositories {
177
+ sonatype {
178
+ nexusUrl.set(uri(" https://s01.oss.sonatype.org/service/local/" ))
179
+ snapshotRepositoryUrl.set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
179
180
180
- username.set(env[" SONATYPE_USERNAME" ])
181
- password.set(env[" SONATYPE_PASSWORD" ])
181
+ username.set(env[" SONATYPE_USERNAME" ])
182
+ password.set(env[" SONATYPE_PASSWORD" ])
183
+ }
182
184
}
183
185
}
184
186
}
Original file line number Diff line number Diff line change
1
+ package xyz.theprogramsrc.filesmodule
2
+
3
+ import xyz.theprogramsrc.simplecoreapi.global.models.module.Module
4
+ import xyz.theprogramsrc.simplecoreapi.global.models.module.ModuleDescription
5
+
6
+ class FilesModule : Module {
7
+
8
+ override val description: ModuleDescription =
9
+ ModuleDescription (
10
+ name = " @name@" ,
11
+ version = " @version@" ,
12
+ authors = listOf (" Im-Fran" )
13
+ )
14
+
15
+ override fun onDisable () {
16
+ TODO (" Not yet implemented" )
17
+ }
18
+
19
+ override fun onEnable () {
20
+ TODO (" Not yet implemented" )
21
+ }
22
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
package xyz.theprogramsrc.filesmodule.config
2
2
3
3
import com.google.gson.*
4
- import xyz.theprogramsrc.filesmodule. utils.file
4
+ import xyz.theprogramsrc.simplecoreapi.global. utils.extensions .file
5
5
import java.io.File
6
6
7
7
/* *
Original file line number Diff line number Diff line change 1
1
package xyz.theprogramsrc.filesmodule.config
2
2
3
- import xyz.theprogramsrc.filesmodule. utils.file
3
+ import xyz.theprogramsrc.simplecoreapi.global. utils.extensions .file
4
4
import java.io.File
5
5
import java.util.*
6
6
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package xyz.theprogramsrc.filesmodule.config
2
2
3
3
import org.simpleyaml.configuration.ConfigurationSection
4
4
import org.simpleyaml.configuration.file.YamlConfiguration
5
- import xyz.theprogramsrc.filesmodule. utils.file
5
+ import xyz.theprogramsrc.simplecoreapi.global. utils.extensions .file
6
6
import java.io.File
7
7
8
8
/* *
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -8,22 +8,6 @@ import java.io.File
8
8
9
9
internal class JsonConfigTest {
10
10
11
- companion object {
12
- private val config = JsonConfig (File (" test.json" ))
13
-
14
- @BeforeAll
15
- fun setUp () {
16
- config.destroy()
17
- config.load()
18
- }
19
-
20
- @AfterAll
21
- fun tearDown () {
22
- config.destroy()
23
- }
24
-
25
- }
26
-
27
11
@Test
28
12
fun has () {
29
13
assertFalse(config.has(" test" ))
@@ -81,4 +65,22 @@ internal class JsonConfigTest {
81
65
assertEquals(3 as Number , config.getNumber(" addNumber" ))
82
66
config.remove(" addNumber" )
83
67
}
68
+
69
+ companion object {
70
+ private val config = JsonConfig (File (" test.json" ))
71
+
72
+ @JvmStatic
73
+ @BeforeAll
74
+ fun setUp () {
75
+ config.destroy()
76
+ config.load()
77
+ }
78
+
79
+ @JvmStatic
80
+ @AfterAll
81
+ fun tearDown () {
82
+ config.destroy()
83
+ }
84
+
85
+ }
84
86
}
Original file line number Diff line number Diff line change @@ -8,22 +8,6 @@ import java.io.File
8
8
9
9
internal class PropertiesConfigTest {
10
10
11
- companion object {
12
- private val config = PropertiesConfig (File (" test.properties" ))
13
-
14
- @BeforeAll
15
- fun setUp () {
16
- config.destroy()
17
- config.load()
18
- }
19
-
20
- @AfterAll
21
- fun tearDown () {
22
- config.destroy()
23
- }
24
-
25
- }
26
-
27
11
@Test
28
12
fun has () {
29
13
assertFalse(config.has(" test" ))
@@ -56,4 +40,23 @@ internal class PropertiesConfigTest {
56
40
assertNull(config.get(" test" ))
57
41
assertFalse(config.has(" test" ))
58
42
}
43
+
44
+ companion object {
45
+ private val config = PropertiesConfig (File (" test.properties" ))
46
+
47
+ @JvmStatic
48
+ @BeforeAll
49
+ fun setUp () {
50
+ config.destroy()
51
+ config.load()
52
+ }
53
+
54
+ @JvmStatic
55
+ @AfterAll
56
+ fun tearDown () {
57
+ config.destroy()
58
+ }
59
+
60
+ }
61
+
59
62
}
Original file line number Diff line number Diff line change @@ -8,22 +8,6 @@ import java.io.File
8
8
9
9
internal class YmlConfigTest {
10
10
11
- companion object {
12
- private val config = YmlConfig (File (" test.yml" ))
13
-
14
- @BeforeAll
15
- fun setUp () {
16
- config.destroy()
17
- config.load()
18
- }
19
-
20
- @AfterAll
21
- fun tearDown () {
22
- config.destroy()
23
- }
24
-
25
- }
26
-
27
11
@Test
28
12
fun hasAndSet () {
29
13
assertFalse(config.has(" test" ))
@@ -71,4 +55,22 @@ internal class YmlConfigTest {
71
55
assertTrue(config.has(" test" ))
72
56
config.remove(" test" )
73
57
}
58
+
59
+ companion object {
60
+ private val config = YmlConfig (File (" test.yml" ))
61
+
62
+ @JvmStatic
63
+ @BeforeAll
64
+ fun setUp () {
65
+ config.destroy()
66
+ config.load()
67
+ }
68
+
69
+ @JvmStatic
70
+ @AfterAll
71
+ fun tearDown () {
72
+ config.destroy()
73
+ }
74
+
75
+ }
74
76
}
You can’t perform that action at this time.
0 commit comments