kaby76 / Antlr4BuildTasks

Third-party build tool for 'Official' Antlr4 tool and runtime parsers using .Net. Drop-in replacement for 'Antlr4cs' Antlr4 tool and build rules.
MIT License
76 stars 10 forks source link

Feature request: Not include generated files in Compile #7

Open emphasis87 opened 4 years ago

emphasis87 commented 4 years ago

I would prefer to have the generated files as a part of a git repository insted of being ephemeral.

I tried to set the output path for the .g4 file to '.' and it works perfectly, the sdk project format picks it up immediately. However, since the task adds it as compile items it produces duplicate definition errors.

Would it be possible to add an option to the Antlr4 item to not include the files in Compile list and let the project handle it?

I also removed .interop and .tokens files, since they are not compiled and presumably used only during code generation.

<PropertyGroup>
  <DefaultItemExcludes>$(DefaultItemExcludes);**\*.interp;**\*.tokens</DefaultItemExcludes>
</PropertyGroup>
kaby76 commented 4 years ago

The code is supposed to handle all this, but it's braking in your environment. Could you post the output from "dotnet build --verbosity diagnostic" here? That was the whole point of SubtractList and MakeRelativeList. It's supposed to removing duplicates and those the .tokens and .interp files from the "to do" compile list. Adding a hack option on top isn't fixing the problem here. Thanks.

emphasis87 commented 4 years ago

Ah, it seems it was some strange build cache issue. After clean and build it seems to work. However, .interp and .tokens files remain. Should they have been deleted during the build? Here is the build log: build.txt

kaby76 commented 4 years ago

Well, they should not be on the compile list, but deletion depends on another user option. They may want that to be "source". I will check and adjust the code. Ken

On Thu, Aug 20, 2020, 2:13 PM Luboš Hemala notifications@github.com wrote:

Ah, it seems it was some strange build cache issue. After clean and build it seems to work. However, .interp and .tokens files remain. Should they have been deleted during the build? Here is the build log: build.txt https://github.com/kaby76/Antlr4BuildTasks/files/5104723/build.txt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kaby76/Antlr4BuildTasks/issues/7#issuecomment-677819587, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACW4UC7LOYX5XNZRGFUCIRTSBVRS5ANCNFSM4QGISGNQ .