mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
StampAssemblyInfo
This commit is contained in:
parent
735b81b0fd
commit
8915ce1105
3 changed files with 30 additions and 17 deletions
|
@ -139,12 +139,6 @@
|
|||
<PropertyGroup>
|
||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AppVersion Condition="'$(AppVersion)' == ''">0.0.0.0</AppVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Calculator.rc" PreprocessorDefinitions="%(PreprocessorDefinitions);APP_VERSION_MAJOR=$(AppVersion.Split(`.`)[0]);APP_VERSION_MINOR=$(AppVersion.Split(`.`)[1]);APP_VERSION_BUILD=$(AppVersion.Split(`.`)[2]);APP_VERSION_REVISION=$(AppVersion.Split(`.`)[3])" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AboutFlyout.xaml.cs">
|
||||
<DependentUpon>AboutFlyout.xaml</DependentUpon>
|
||||
|
@ -835,6 +829,7 @@
|
|||
</ItemGroup>
|
||||
</Target>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)build\Calculator.StampAssemblyInfo.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// CSHARP_MIGRATION: TODO:
|
||||
#define APP_FILE_NAME "Calculator"
|
||||
#define APP_FILE_IS_EXE
|
||||
#define APP_PRODUCT_NAME "Microsoft Calculator"
|
||||
#define APP_COMPANY_NAME "Microsoft Corporation"
|
||||
#define APP_COPYRIGHT "\251 Microsoft Corporation. All rights reserved."
|
||||
|
||||
#include "../build/appversion.rc"
|
29
src/build/Calculator.StampAssemblyInfo.targets
Normal file
29
src/build/Calculator.StampAssemblyInfo.targets
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<!--
|
||||
For .NET Core SDK-style projects, the "Version" MSBuild property is written into assembly files
|
||||
automatically. This target provides the same feature in non-SDK-style projects using a
|
||||
generated file.
|
||||
-->
|
||||
|
||||
<PropertyGroup Condition="'$(Version)' != ''">
|
||||
<CompileDependsOn>StampAssemblyInfo;$(CompileDependsOn)</CompileDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="StampAssemblyInfo">
|
||||
<ItemGroup>
|
||||
<AssemblyAttributes Include="AssemblyVersion">
|
||||
<_Parameter1>$(Version)</_Parameter1>
|
||||
</AssemblyAttributes>
|
||||
</ItemGroup>
|
||||
<WriteCodeFragment AssemblyAttributes="@(AssemblyAttributes)"
|
||||
Language="C#"
|
||||
OutputDirectory="$(IntermediateOutputPath)"
|
||||
OutputFile="GeneratedAssemblyInfo.cs">
|
||||
<Output TaskParameter="OutputFile" ItemName="Compile" />
|
||||
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
|
||||
</WriteCodeFragment>
|
||||
</Target>
|
||||
|
||||
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue