Skip to content

Commit f2e0a1c

Browse files
authored
Feat/generate method handles (#354)
2 parents de6ff77 + b361948 commit f2e0a1c

52 files changed

Lines changed: 2308 additions & 672 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
77
javaVersion=25
88
mcVersion=26.1.2
99
group=dev.slne.surf.api
10-
version=3.12.0
10+
version=3.13.0
1111
relocationPrefix=dev.slne.surf.api.libs
1212
snapshot=false

gradle/libs.versions.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ kotlinxCoroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-co
8080
kotlinxCoroutines-reactor = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactor", version.ref = "kotlinxCoroutines" }
8181
kotlinxCoroutines-reactive = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactive", version.ref = "kotlinxCoroutines" }
8282
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlinVersion" }
83+
kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler", version.ref = "kotlinVersion" }
8384
kotlin-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
8485
kotlin-serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "kotlinx-serialization" }
8586
kotlin-serialization-cbor = { module = "org.jetbrains.kotlinx:kotlinx-serialization-cbor", version.ref = "kotlinx-serialization" }
@@ -115,7 +116,7 @@ adventure-nbt = { module = "net.kyori:adventure-nbt", version.ref = "adventure-a
115116

116117
# Velocity
117118
velocity-api = { module = "com.velocitypowered:velocity-api", version.ref = "velocity-api" }
118-
velocity-proxy-ctd = { module = "com.velocityctd:velocity-proxy", version.ref = "velocity-api"}
119+
velocity-proxy-ctd = { module = "com.velocityctd:velocity-proxy", version.ref = "velocity-api" }
119120

120121
# PAPI
121122
placeholder-api = { module = "me.clip:placeholderapi", version.ref = "placeholder-api" }

surf-api-gradle-plugin/surf-api-processor/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ dependencies {
2323

2424
// https://mvnrepository.com/artifact/com.squareup/kotlinpoet
2525
implementation("com.squareup:kotlinpoet:2.3.0")
26+
implementation("com.palantir.javapoet:javapoet:0.7.0")
27+
implementation(libs.kotlin.compiler)
2628
}

surf-api-gradle-plugin/surf-api-processor/src/main/kotlin/dev/slne/surf/api/processor/ClassNames.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package dev.slne.surf.api.processor
22

33
import dev.slne.surf.api.processor.util.nameOf
4+
import dev.slne.surf.api.processor.util.shortNameOf
45
import dev.slne.surf.api.shared.api.component.Priority
56
import dev.slne.surf.api.shared.api.component.SurfComponentMeta
67
import dev.slne.surf.api.shared.api.component.processor.ComponentPostProcessor
78
import dev.slne.surf.api.shared.api.component.requirement.*
9+
import dev.slne.surf.api.shared.api.reflection.*
810
import dev.slne.surf.api.shared.internal.nms.NmsProviderMarker
911

1012
object ClassNames {
@@ -21,4 +23,23 @@ object ClassNames {
2123
val CONDITIONAL_ON_PROPERTY = nameOf<ConditionalOnProperty>()
2224
val COMPONENT_POST_PROCESSOR = nameOf<ComponentPostProcessor>()
2325
val NMS_PROVIDER = nameOf<NmsProviderMarker>()
26+
27+
val GENERATE_REFLECTION = nameOf<GenerateReflection>()
28+
val UNSPECIFIED_REFLECTION_TARGET = nameOf<UnspecifiedReflectionTarget>()
29+
val REFLECTED_METHOD = nameOf<ReflectedMethod>()
30+
val REFLECTED_CONSTRUCTOR = nameOf<ReflectedConstructor>()
31+
val REFLECTED_FIELD = nameOf<ReflectedField>()
32+
val REFLECTED_VAR_HANDLE = nameOf<ReflectedVarHandle>()
33+
val CONSTANT_INT_ARGUMENT = nameOf<ConstantIntArgument>()
34+
val CONSTANT_LONG_ARGUMENT = nameOf<ConstantLongArgument>()
35+
val CONSTANT_BOOLEAN_ARGUMENT = nameOf<ConstantBooleanArgument>()
36+
val CONSTANT_STRING_ARGUMENT = nameOf<ConstantStringArgument>()
37+
}
38+
39+
object ShortClassNames {
40+
val GENERATE_REFLECTION = shortNameOf<GenerateReflection>()
41+
val CONSTANT_INT_ARGUMENT = shortNameOf<ConstantIntArgument>()
42+
val CONSTANT_LONG_ARGUMENT = shortNameOf<ConstantLongArgument>()
43+
val CONSTANT_BOOLEAN_ARGUMENT = shortNameOf<ConstantBooleanArgument>()
44+
val CONSTANT_STRING_ARGUMENT = shortNameOf<ConstantStringArgument>()
2445
}

0 commit comments

Comments
 (0)