copyIdeResources not working in VSCode
Processed resource files are in build/resources, but VSCode debugger uses the resources in bin directory, this causes the mods.toml cannot be parsed and fail to launch:
Exception in thread "main" com.electronwill.nightconfig.core.io.ParsingException: Invalid bare key: ${mod_id}
My temporary solution is:
-
copyVSCodeResourcestask inbuild.gradle:task copyVSCodeResources (dependsOn: 'processResources', type: Copy) { from 'build/resources' into 'bin/' } -
preLaunchTaskinlaunch.json:{ "version": "0.2.0", "configurations": [ { "type": "java", "name": "runClient", // ... "preLaunchTask": "gradle: copyVSCodeResources" } // ... ] }
I think this could be integrated into the NeoGradle.
Facing the same issue, but I hack in using gradle eclipse model, although solution above seems a bit cleaner as it points to normal gradle processResources
eclipse {
autoBuildTasks processResourcesEclipse
}
task processResourcesEclipse(type: Copy) {
var buildPath = resolveEclipseBuildPath()
from "$rootDir/src/main/resources/"
into "$buildPath/main/"
filesMatching ('**/mods.toml') {
expand project.properties
}
}
def resolveEclipseBuildPath() {
var buildPath = eclipse.classpath.getDefaultOutputDir().toPath()
if (buildPath.toString().endsWith("default")) {
buildPath = buildPath.getParent()
}
return buildPath
}
My temporary solution is:
copyVSCodeResourcestask inbuild.gradle:task copyVSCodeResources (dependsOn: 'processResources', type: Copy) { from 'build/resources' into 'bin/' }preLaunchTaskinlaunch.json:{ "version": "0.2.0", "configurations": [ { "type": "java", "name": "runClient", // ... "preLaunchTask": "gradle: copyVSCodeResources" } // ... ] }I think this could be integrated into the NeoGradle.
@marchermans only works by doing this on 7.0.150 i need to have "preLaunchTask": "gradle: copyVSCodeResources" to make it work but everytime i launch the game and save a file. it overwrites the launch.json file and removes that