utopia-rise / godot-kotlin-jvm

Godot Kotlin JVM Module
MIT License
576 stars 39 forks source link

Location of services "godot.registration.Entry" file is hardcoded. #538

Open RobertZenz opened 9 months ago

RobertZenz commented 9 months ago

The location of the services "godot.registration.Entry" file is currently hardcoded in three places:

  1. EntryGenerator.kt
  2. build.gradle.kts
  3. packageMainDexJarTask.kt

That has given me some trouble as I tried to move the location of the source sets. To be exact, I wanted to split my project into two source directories: src and src.godot. This might not be that Gradle like, but for me it would make sense in this project. I've tried to do that by redefining source sets:

sourceSets {
    main.java.srcDirs = [ 'src', 'src.godot' ]
    main.resources.srcDirs = [ 'src', 'src.godot' ]

    test.java.srcDirs = [ 'src.test' ]
    test.resources.srcDirs = [ 'src.test' ]
}

Obviously, the service file is now always located under src/main/resources/... which clashes with such a layout.

I'm not familiar with Gradle that much, but would it be possible to resolve the target location for the service during the build, for example sourceSets.main.resources.srcDirs[0] would be a good candidate, I guess.