Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copyIdeResources not working in VSCode #5

Open
WakelessSloth56 opened this issue Sep 5, 2023 · 2 comments
Open

copyIdeResources not working in VSCode #5

WakelessSloth56 opened this issue Sep 5, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@WakelessSloth56
Copy link

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}
@WakelessSloth56
Copy link
Author

My temporary solution is:

  1. copyVSCodeResources task in build.gradle:

    task copyVSCodeResources (dependsOn: 'processResources', type: Copy) {
        from 'build/resources'
        into 'bin/'
    }
  2. preLaunchTask in launch.json:

    {
        "version": "0.2.0",
        "configurations": [
             {
                "type": "java",
                "name": "runClient",
                 // ...
                "preLaunchTask": "gradle: copyVSCodeResources"
            }
            // ...
        ]
    }

I think this could be integrated into the NeoGradle.

@Nightenom
Copy link
Contributor

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
}

Technici4n pushed a commit to Technici4n/NeoGradle that referenced this issue Oct 23, 2023
…_params

Use work params for asset downloading
@sciwhiz12 sciwhiz12 added the bug Something isn't working label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants