godot-kotlin-jvm
godot-kotlin-jvm copied to clipboard
Can't build the project if there is a test source set
The entry generation happens on the test source set as well, not just the main one. The issue is that the test source set also does not have the godot library, so if you try to make tests then you can't compile it anymore.
The easy fix is to add the library to the implementation config so it transitions to the test source set as well.
dependencies {
// https://mvnrepository.com/artifact/com.utopia-rise/godot-library
implementation("com.utopia-rise:godot-library:0.7.2-4.1.2")
}
It does not really matter that the generator processes that too, only that you can't compile it anymore.
The main question for me here is; should we generate entry files for the tests or not. IMO the dependency should always be added which would fix this issue short term, but the above base question still remains.
What are your thoughts @CedNaru and @Frontrider ?
I don't see the point of an entry for tests. It's not like we are going to use it anyway. Maybe in the future, we can turn Godot into some kind of Junit runner that would just load the test entry so we can directly test Kotlin scripts. But as it is now, I don't see the point. Adding the library in the main.jar also bothers me. Even if there is no conflict, it's still a duplicate of data. Godot library should then be removed from the bootstrap.jar, or we should up the priority of switching to C++ reloading and get rid of bootstrap.jar for good.
No need for entry files at all. There is nothing in a test source set that needs it.
I'll have to check if this works or not. (yes I know that it is needed because of the entry generation)
dependencies {
// https://mvnrepository.com/artifact/com.utopia-rise/godot-library
testImplementation("com.utopia-rise:godot-library:0.7.2-4.1.2")
}
But yes, If you make it so that the entry file is not produced unless there is anything to put in there then that is a better solution.
As mentioned in the closed PR, this issue will automatically be solved once we switch to KSP 2.0