The question is: is there a way to have a setting in the *.tt file so that the generated files are set to a specified Build Action?
The thing is I am generating SQL script using a template. I use this script as pre-deploy script in Database project. Currently, I have to manually set the Build Action to Pre-Deploy every time a file being re-generated - I would like to automate it.
Both files - template and SQL that it generates - are included into project. In Project (*.sqlproj) they are as next tags:
<PreDeploy Include="Migration\PreDeployScript.sql">
<DependentUpon>Migration\PreDeployScript.tt</DependentUpon>
</PreDeploy>
and
<None Include="Migration\PreDeployScript.tt">
<Generator>TextTemplatingFileGenerator</Generator>
</None>
When I run Custom Tool to re-generate SQL (I need to do it quite often), then PreDeploy tag is removed and Build tag is put on its place. Like this:
<Build Include="Migration\PreDeployScript.sql">
<DependentUpon>Migration\PreDeployScript.tt</DependentUpon>
</Build>
It breaks the project and I need to manually change back Build to PreDeploy.
Can specify something in Template file to preserve build action PreDeploy all the time?
Thank you!