I have a custom build step in a Visual Studio 2013 solution. The custom build step calls a python script on a text file that refers to several other files in my solution. I want the custom build step to be called whenever any of those files change or when the output of my script is missing. However, I don't want to manually maintain the custom tool "additional dependencies" and "outputs" fields.
I can easily make the script generate a list of dependencies in the same way that gcc can generate a .d file when passed in -MM. Is there a way I can use the .d output of my script to automatically populate the "Additional Dependencies" in my Custom Build step? Is there some other way to avoid maintaining the "additional dependencies" and "outputs" fields"?
The help page only shows how to add individual files.
Assuming that your script for generating .d
files can generate files in any format that you want, you should be able to achieve the results that you need with the use of Import
element:
.d
file. The output of your script would be a small project file that contains the "additional dependencies" and the "outputs" fields.Import
tag to make the generated file a dependency of your main projectThis approach lets you maintain the main project file separately from the auto-generated dependency file, which could be re-generated as needed. The only drawback is that your generated dependency file is an MSBuild project file, not a pure dependency file. However, this should not be a huge problem, because you own the script that generates the dependency file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With