Hi, i want to use kotlin for my next project but i...
# gradle
c
Hi, i want to use kotlin for my next project but im not sure how i should configure the project. The plan is to make a Minecraft plugin that would run in bith Fabric and Spigot servers, using mostly common code with a few platform-specific classes. How can I set this up in Gradle?
v
Not really a Kotlin question actually. But you probably make three subprojects, one for common code, one for fabric specifics, one for spigot specifics. The latter ones will depend on the common one.
b
You could use kotlin multiplatform, with common/fabric/spigot source sets. Kotlin has `expect`/`actual` declarations, so you could make
expect
declarations (e.g.
expect class Player
) in the common module for platform-specific things, and then put
actual
declarations in the fabric/spigot source sets.