Repository navigation
Expand file tree
/
Copy pathCommon.props
More file actions
26 lines (26 loc) · 1.5 KB
/
Copy pathCommon.props
File metadata and controls
26 lines (26 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ComputedSolutionDir>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</ComputedSolutionDir>
<CommonEnvVars>
</CommonEnvVars>
<!-- Source files are listed explicitly in the .synproj. Set here because the Synergy VS tooling strips it from the .synproj. -->
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<!--
The Synergy build does not generate assembly version attributes, so generate them from $(Version).
The pipeline passes /p:Version=$(currentVersion); local builds get the SDK default of 1.0.0.
-->
<Target Name="GenerateVersionInfo" BeforeTargets="CoreCompile">
<PropertyGroup>
<_VersionInfoFile>$(IntermediateOutputPath)VersionInfo.dbl</_VersionInfoFile>
<_NumericVersion>$([System.Text.RegularExpressions.Regex]::Match('$(Version)', '^\d+(\.\d+){0,3}').Value)</_NumericVersion>
</PropertyGroup>
<WriteLinesToFile File="$(_VersionInfoFile)" Overwrite="true" WriteOnlyWhenDifferent="true"
Lines="import System.Reflection;{assembly: AssemblyVersion("$(_NumericVersion)")};{assembly: AssemblyFileVersion("$(_NumericVersion)")};{assembly: AssemblyInformationalVersion("$(Version)")}" />
<ItemGroup>
<Compile Include="$(_VersionInfoFile)" />
<FileWrites Include="$(_VersionInfoFile)" />
</ItemGroup>
</Target>
</Project>