Replies: 1 comment 1 reply
-
The source generator runs at compile time so unfortunately we need something that is known at compile time. The only way to make this more dynamic would be to define an environment variable which PureHDF accepts as a prefix path or as the full path. I guess environment variables can also be set in Visual Studio but maybe they are set too late (after compilation instead of before compilation). This is something that needs to be tested. However you could set the environment variable in your OS independent of Visual Studio. If this is a good solution depends on if you need the source generator for different projects / different h5 files. In that case you would need different environment variables or change their content when you switch projects. What do you think, would an environment variable solve your problem? |
Beta Was this translation helpful? Give feedback.
-
Hello again, just want to know if its possible to change the type of filePath on: [H5SourceGenerator(filePath: HDF5Read.FILE_PATH)] internal partial class MyGeneratedH5Bindings { }; , because only can be const, or if its possible to pass another path to the .h5 file, because I also repair that just accept the hardcode path like "C:\user\..." and I like to use the path from a local folder on my project without the hardcode path.
Beta Was this translation helpful? Give feedback.
All reactions