Skip to content

Commit a4669ff

Browse files
committed
chore: Use Kotlin DSL in test build scripts
1 parent 776be44 commit a4669ff

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/test/groovy/ru/endlesscode/bukkitgradle/PluginSpecification.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ class PluginSpecification extends Specification {
2222
protected BuildResult result
2323

2424
def setup() {
25-
buildFile = file('build.gradle')
26-
settingsFile = file('settings.gradle')
25+
buildFile = file('build.gradle.kts')
26+
settingsFile = file('settings.gradle.kts')
2727

28-
//language=gradle
28+
//language=kotlin
2929
buildFile << '''
3030
plugins {
31-
id 'ru.endlesscode.bukkitgradle'
31+
id("ru.endlesscode.bukkitgradle")
3232
}
3333
34-
version = '1.0'
35-
group = 'com.example.testplugin'
34+
version = "1.0"
35+
group = "com.example.testplugin"
3636
'''.stripIndent()
3737

3838
settingsFile << '''
39-
rootProject.name = 'test-plugin'
39+
rootProject.name = "test-plugin"
4040
'''.stripIndent()
4141
}
4242

src/test/groovy/ru/endlesscode/bukkitgradle/plugin/task/MergePluginYamlSpec.groovy

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ class MergePluginYamlSpec extends PluginSpecification {
121121

122122
void 'when merge plugin.yaml - and all properties configured - should write all lines'() {
123123
given: "configured all plugin properties"
124-
//language=gradle
124+
//language=kotlin
125125
buildFile << """
126126
bukkit {
127127
plugin {
128-
name.set('TestPlugin')
129-
description.set('Test plugin description')
130-
main.set('com.example.plugin.Plugin')
131-
version.set('0.1')
132-
apiVersion.set('1.13')
133-
url.set('http://www.example.com/')
134-
authors.set(["OsipXD", "Contributors"])
128+
name.set("TestPlugin")
129+
description.set("Test plugin description")
130+
main.set("com.example.plugin.Plugin")
131+
version.set("0.1")
132+
apiVersion.set("1.13")
133+
url.set("https://www.example.com/")
134+
authors.set(listOf("OsipXD", "Contributors"))
135135
}
136136
}
137137
""".stripIndent()
@@ -147,22 +147,22 @@ class MergePluginYamlSpec extends PluginSpecification {
147147
version: "0.1"
148148
api-version: "1.13"
149149
authors: ["OsipXD", "Contributors"]
150-
website: "http://www.example.com/"
150+
website: "https://www.example.com/"
151151
""".stripIndent().trim()
152152
}
153153

154-
void 'when merge plugin.yaml - and all properties configured old way - should write all lines'() {
154+
void 'when merge plugin.yaml - and all properties configured with assignment - should write all lines'() {
155155
given: "configured all plugin properties in old way"
156-
//language=gradle
156+
//language=kotlin
157157
buildFile << """
158158
bukkit {
159159
plugin {
160-
name = 'TestPlugin'
161-
description = 'Test plugin description'
162-
main = 'com.example.plugin.Plugin'
163-
version = '0.1'
164-
url = 'http://www.example.com/'
165-
authors = ["OsipXD", "Contributors"]
160+
name = "TestPlugin"
161+
description = "Test plugin description"
162+
main = "com.example.plugin.Plugin"
163+
version = "0.1"
164+
url = "https://www.example.com/"
165+
authors = listOf("OsipXD", "Contributors")
166166
}
167167
}
168168
""".stripIndent()
@@ -178,7 +178,7 @@ class MergePluginYamlSpec extends PluginSpecification {
178178
version: "0.1"
179179
api-version: "1.16"
180180
authors: ["OsipXD", "Contributors"]
181-
website: "http://www.example.com/"
181+
website: "https://www.example.com/"
182182
""".stripIndent().trim()
183183
}
184184

0 commit comments

Comments
 (0)