eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.
https://eclipse.org/lsp4j
Other
599 stars 143 forks source link

Cannot build with gradle on windows #734

Closed ghentschke closed 1 year ago

ghentschke commented 1 year ago

I tried to build with gradle on my Windows machine according to this description and get the following error during: 4. Run the "eclipse assemble" gradle targets.:

java.nio.file.InvalidPathException: Illegal char <:> at index 50: C:\git_SC_202212\lsp4j\org.eclipse.lsp4j.jsonrpc\C:git_SC_202212lsp4jorg.eclipse.lsp4j.jsonrpcbuild\tmp\bnd\MANIFEST.MF
    at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
    at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
    at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
    at java.base/java.io.File.toPath(File.java:2387)

It seems that the Windows path C:\git_SC_202212\lsp4j\org.eclipse.lsp4j.jsonrpc cannot be correctly resolved

cdietrich commented 1 year ago

maybe something like "-savemanifest": "${buildDir.path.replace("\\", "/")}/tmp/bnd/MANIFEST.MF", helps to get bnd to deal with mix of forward and backwards slashes or we use something to make the slashes backslashes on windows

jonahgraham commented 1 year ago

@ghentschke I have pushed a fix which appears to solve the issue for me, both on CI (which now does Windows builds too #736) and on my local windows machine.

Please let me know if you still run into issues with working on LSP4J from source.

jonahgraham commented 1 year ago

maybe something like "-savemanifest": "${buildDir.path.replace("\\", "/")}/tmp/bnd/MANIFEST.MF", helps to get bnd to deal with mix of forward and backwards slashes or we use something to make the slashes backslashes on windows

I couldn't get this to work, not sure what I may have been doing wrong, see #737 for my alternative.

cdietrich commented 1 year ago

guess the alternative is also ok as log as the build dir is not changed. wonder why it worked on my windows. maybe there is differences between different windows machines and locactions