Skip to content

Commit f45fbd3

Browse files
committed
chore: Remove deprecated APIs
1 parent a4669ff commit f45fbd3

File tree

5 files changed

+2
-79
lines changed

5 files changed

+2
-79
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
- Target JVM 1.8 → 17
3434
- Gradle 7.2 → 8.13
35+
- Remove old deprecated APIs
3536

3637
## [0.10.1] - 2021-11-07
3738

src/main/kotlin/BukkitExtension.kt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ import org.gradle.api.Action
44
import org.gradle.api.Project
55
import org.gradle.api.model.ObjectFactory
66
import org.gradle.api.provider.Property
7-
import org.gradle.kotlin.dsl.assign
87
import org.gradle.kotlin.dsl.getByType
98
import org.gradle.kotlin.dsl.property
10-
import org.slf4j.LoggerFactory
119
import ru.endlesscode.bukkitgradle.extensions.finalizedOnRead
12-
import ru.endlesscode.bukkitgradle.extensions.warnSyntaxChanged
1310
import ru.endlesscode.bukkitgradle.plugin.extension.PluginConfigurationImpl
1411
import ru.endlesscode.bukkitgradle.server.ServerConstants
1512
import ru.endlesscode.bukkitgradle.server.extension.ServerConfigurationImpl
1613

17-
// TODO 1.0: Remove deprecated fields on release
1814
public open class BukkitExtension internal constructor(
1915
public final override val plugin: PluginConfigurationImpl,
2016
public final override val server: ServerConfigurationImpl,
@@ -25,21 +21,6 @@ public open class BukkitExtension internal constructor(
2521
.convention(ServerConstants.DEFAULT_VERSION)
2622
.finalizedOnRead()
2723

28-
private val logger = LoggerFactory.getLogger("BukkitExtension")
29-
30-
@Deprecated("Use 'server' instead", ReplaceWith("server"))
31-
public val run: ServerConfigurationImpl
32-
get() {
33-
logger.warnSyntaxChanged("bukkit.run", "bukkit.server")
34-
return server
35-
}
36-
37-
@Deprecated("Use 'server { ... }' instead", ReplaceWith("server(body)"))
38-
public fun run(body: Action<ServerConfigurationImpl>) {
39-
logger.warnSyntaxChanged("bukkit.run { ... }", "bukkit.server { ... }")
40-
server(body)
41-
}
42-
4324
public fun server(body: Action<ServerConfigurationImpl>) {
4425
body.execute(server)
4526
}
@@ -53,12 +34,6 @@ public open class BukkitExtension internal constructor(
5334
plugin(body)
5435
}
5536

56-
@Deprecated("Use apiVersion instead of version.", ReplaceWith("apiVersion = version"))
57-
public fun setVersion(version: String) {
58-
logger.warnSyntaxChanged("bukkit.version = '...'", "bukkit.apiVersion = '...'")
59-
apiVersion = version
60-
}
61-
6237
/** Disables plugin.yml generation. */
6338
@Deprecated(
6439
"Use 'plugin.disablePluginYamlGeneration()' instead",

src/main/kotlin/extensions/Logger.kt

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/main/kotlin/plugin/extension/PluginConfigurationImpl.kt

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ import org.gradle.api.provider.ListProperty
55
import org.gradle.api.provider.Property
66
import org.gradle.kotlin.dsl.listProperty
77
import org.gradle.kotlin.dsl.property
8-
import org.slf4j.LoggerFactory
98
import ru.endlesscode.bukkitgradle.extensions.finalizedOnRead
10-
import ru.endlesscode.bukkitgradle.extensions.warnSyntaxChanged
119

12-
// TODO 1.0: Remove deprecated methods
1310
public class PluginConfigurationImpl(objects: ObjectFactory) : PluginConfiguration {
1411

1512
private val _generatePluginYaml: Property<Boolean> = objects.property<Boolean>()
@@ -25,44 +22,6 @@ public class PluginConfigurationImpl(objects: ObjectFactory) : PluginConfigurati
2522
override val url: Property<String> = objects.property()
2623
override val authors: ListProperty<String> = objects.listProperty()
2724

28-
private val logger = LoggerFactory.getLogger("PluginConfiguration")
29-
30-
@Deprecated("Use property syntax instead", ReplaceWith("this.name.set(name)"))
31-
public fun setName(name: String) {
32-
logger.warnSyntaxChanged("bukkit.plugin.name = '...'", "bukkit.plugin.name.set('...')")
33-
this.name.set(name)
34-
}
35-
36-
@Deprecated("Use property syntax instead", ReplaceWith("this.description.set(description)"))
37-
public fun setDescription(description: String) {
38-
logger.warnSyntaxChanged("bukkit.plugin.description = '...'", "bukkit.plugin.description.set('...')")
39-
this.description.set(description)
40-
}
41-
42-
@Deprecated("Use property syntax instead", ReplaceWith("this.main.set(main)"))
43-
public fun setMain(main: String) {
44-
logger.warnSyntaxChanged("bukkit.plugin.main = '...'", "bukkit.plugin.main.set('...')")
45-
this.main.set(main)
46-
}
47-
48-
@Deprecated("Use property syntax instead", ReplaceWith("this.version.set(version)"))
49-
public fun setVersion(version: String) {
50-
logger.warnSyntaxChanged("bukkit.plugin.version = '...'", "bukkit.plugin.version.set('...')")
51-
this.version.set(version)
52-
}
53-
54-
@Deprecated("Use property syntax instead", ReplaceWith("this.url.set(url)"))
55-
public fun setUrl(url: String) {
56-
logger.warnSyntaxChanged("bukkit.plugin.url = '...'", "bukkit.plugin.url.set('...')")
57-
this.url.set(url)
58-
}
59-
60-
@Deprecated("Use property syntax instead", ReplaceWith("this.authors.set(authors)"))
61-
public fun setAuthors(authors: List<String>) {
62-
logger.warnSyntaxChanged("bukkit.plugin.authors = [...]", "bukkit.plugin.authors.set([...])")
63-
this.authors.set(authors)
64-
}
65-
6625
/** Disables plugin.yaml parsing and generation. */
6726
public fun disablePluginYamlGeneration() {
6827
_generatePluginYaml.set(false)

src/test/groovy/ru/endlesscode/bukkitgradle/server/task/PrepareServerSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PrepareServerSpec extends PluginSpecification {
3333
given: "configured online-mode"
3434
buildFile << """
3535
bukkit {
36-
run {
36+
server {
3737
onlineMode = false
3838
}
3939
}

0 commit comments

Comments
 (0)