diff options
author | Miguel Costa <miguel.costa@qt.io> | 2018-11-23 18:07:43 +0100 |
---|---|---|
committer | Miguel Costa <miguel.costa@qt.io> | 2018-11-28 09:45:13 +0000 |
commit | 1ffd6fc620195523dc29173780cc92373454928a (patch) | |
tree | d2d951b5d44820ab9de9f1cc6fe4f65dcada60f7 /src/qttemplates/widget/Widget.csproj | |
parent | e2445defc5a80667a4afc5f9edf1f52845f25e81 (diff) |
Automate change of version number
Before this patch, there were 40+ different locations in the source
files where the version number was stored. The version number is now
defined in a single source file as the property $(QtVSToolsVersion).
Other sources that use the version string are then generated from
corresponding templates using the template engine included in Visual
Studio (Text Template Transformation Toolkit, or T4). Projects that
integrate with the Qt VS Tools will also have access to the version
definition property.
Change-Id: Ib3a372c6f0e0c446eef98b4fa26b58e1565bb025
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/qttemplates/widget/Widget.csproj')
-rw-r--r-- | src/qttemplates/widget/Widget.csproj | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/qttemplates/widget/Widget.csproj b/src/qttemplates/widget/Widget.csproj index a96740ea..91cf7755 100644 --- a/src/qttemplates/widget/Widget.csproj +++ b/src/qttemplates/widget/Widget.csproj @@ -50,7 +50,17 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <ItemGroup> - <Compile Include="Properties\AssemblyInfo.cs" /> + <T4Template Include="Properties\AssemblyInfo.cs"> + <Generator>TextTemplatingFileGenerator</Generator> + <OutputFile>Properties\AssemblyInfo.tt.cs</OutputFile> + <DependsOn>$(SolutionDir)\version.tt;$(SolutionDir)\common.tt</DependsOn> + <LastGenOutput>AssemblyInfo.tt.cs</LastGenOutput> + </T4Template> + <Compile Include="Properties\AssemblyInfo.tt.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>AssemblyInfo.cs</DependentUpon> + </Compile> </ItemGroup> <ItemGroup> <Content Include="widget.ico" /> @@ -59,6 +69,9 @@ <OutputSubPath>Qt</OutputSubPath> </VSTemplate> </ItemGroup> + <ItemGroup> + <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. |