Github
I’m including two module from files by gradle
But I can’t use the functions from it.
import me.settingdust.laven.sponge.registerListener
import org.slf4j.Logger
import org.spongepowered.api.event.game.state.GameInitializationEvent
import org.spongepowered.api.plugin.PluginContainer
class SpongeTemplate @Inject constructor(
logger: Logger,
pluginContainer: PluginContainer
) {
init {
pluginContainer.registerListener<GameInitializationEvent> {
logger.info("Template plugin is running!")
}
}
}
There is the error
> Task :compileKotlin FAILED
e: E:\Sponge\sponge-template\src\main\kotlin\org\example\spongetemplate\SpongeTemplate.kt: (4, 36): Unresolved reference: registerListener
e: E:\Sponge\sponge-template\src\main\kotlin\org\example\spongetemplate\SpongeTemplate.kt: (14, 25): Unresolved reference: registerListener
https://gradle.com/s/bdhpq7lxjnbio
I can’t check out your project https://github.com/SettingDust/sponge-template/tree/kotlin-laven: laven-sponge
is an empty directory.
It’s a git submodule. Not empty. Try to run git submodule update --init --recursive
?
Thank you, reproduced. When I remove mentions of publishing, shadowJar, jar in laven-sponge
build file, the project starts to build. Looks like this is not Kotlin-related, maybe a shadowing issue.
Is it a issue caused by the shadow in submodule?
I think so. Try to remove shadowing from the build file.