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

Can't generate result if build configuration contains space in it #320

Open
boydc2014 opened this issue Mar 18, 2019 · 4 comments · May be fixed by #332
Open

Can't generate result if build configuration contains space in it #320

boydc2014 opened this issue Mar 18, 2019 · 4 comments · May be fixed by #332

Comments

@boydc2014
Copy link

boydc2014 commented Mar 18, 2019

Everything works great if i use Debug|AnyCpu or Release|AnyCpu, but a certain build configuration let's say "Debug - nuget packages|Anycpu" won't generate any output in obj/Debug - nuget packages folder.

Eventually I found the pattern is, as long as the build configuration name contains space in it, it won't generate output as expected, otherwise it's ok.

'My Config' won't work, and 'MyConfig' works.

Version: antlr4cs 4.6.2
Env: Win10, VS2017 15.7

@Danieladu
Copy link

Met the same issue too

@boydc2014
Copy link
Author

@sharwell i'm willing to fix it if you can help direct me where to locate the specific code\script

@sharwell
Copy link
Member

The issue probably lies in this file:

https://github.com/tunnelvisionlabs/antlr4cs/blob/master/runtime/CSharp/Antlr4BuildTasks/Antlr4ClassGenerationTaskInternal.cs

However, the best way to help might be updating the three DotnetValidation* tests in https://github.com/tunnelvisionlabs/antlr4cs/tree/master/build to have spaces in the paths. This would give integration test coverage to each of the three major ways code can be generated by the tool during builds.

@rkanagy
Copy link

rkanagy commented Mar 20, 2020

Actually, having the space in the build configuration name is not really the issue. The issue is that it has to put quotes around the output folder in the java command when there are spaces in the build configuration. I was able to verify this by running the java command in a command window that I was able to retrieve from the Visual Studio build log when setting the logging to Diagnostic. I had a temp folder named obj\Temp and when I used that output folder without quotes, it wrote the Antlr generated files to that folder. But, when I ran the same command, but with quotes around "obj\Temp", as shown here, the output files were not created. I hope this sheds some light on where the problem lies in the source code. It seems that when the command line arguments are processed, it is not checking for quotes around the output folder and then stripping them out.

So, it looks like the issue is with the Java code in the .jar file that is included in the nuget package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants