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
75 stars 10 forks source link

Fix MakeRelativeList task #57

Closed mrfootoyou closed 1 year ago

mrfootoyou commented 1 year ago

Addresses issue https://github.com/kaby76/Antlr4BuildTasks/issues/14 -- when given an absolute path outside of the working directory on linux, the MakeRelativeList task was converting the absolute path to an invalid relative path.

I implemented a full blown version of "GetRelativePath" which will return a correct relative path as long as the source path is on the same drive as the project directory. If they are not on same drive the original absolute path is returned.

mrfootoyou commented 1 year ago

FYI: The Test job in the .NET workflow is not using the locally built package. For example:

Installed Antlr4BuildTasks 12.0.0 from https://api.nuget.org/v3/index.json with content hash 5EMIhAb3+RJvt1pRIWlTpUG7xBfv4H5cVPqgo4ilYYujEjA8k2vAZmqy9hoh0iya9Hi4/mdn90GDfaFhRED2bg==. 

It seems it's a PackageReference to Antlr4BuildTasks in the .csproj's in the tests. It can probably be rewritten to ProjectReference. (I think the code won't work if Antlr4.Runtime.Standard is a ProjectReference instead of PackageReference, which should also problem be fixed so one can develop locally in different ways.)

kaby76 commented 1 year ago

Thanks for the update.