提交 89c2dc04 authored 作者: Andrey Volk's avatar Andrey Volk

FS-11513: [Build-System] Fix Windows versioning.

上级 abec4dea
......@@ -5,5 +5,6 @@ FOR /f "delims=" %%i in ('FIND /N "AC_INIT" ..\..\configure.ac') DO SET version_
FOR /f "tokens=2 delims=," %%a in ("%version_contained_string%") DO SET dirty_version=%%a
SET almost_clean_version=%dirty_version:[=%
SET version_with_spaces=%almost_clean_version:]=%
SET full_version=%version_with_spaces: =%
SET version_with_dash=%version_with_spaces: =%
FOR /f "tokens=1 delims=-" %%a in ("%version_with_dash%") DO SET full_version=%%a
echo %full_version%
\ No newline at end of file
......@@ -926,7 +926,10 @@
<Exec Command="$(SolutionDir)w32\Setup\FullVersion.cmd" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="FullVersion" />
</Exec>
<CreateProperty Condition="'$(GitCommits)' != '0'" Value="-snapshot-$(GitCommit)-$([System.DateTime]::Now.ToString(yyyyMMddHHmmss))">
<CreateProperty Condition="'$(Configuration)' == 'Debug'" Value="-debug">
<Output TaskParameter="Value" PropertyName="DebugConfiguration" />
</CreateProperty>
<CreateProperty Condition="'$(GitCommits)' != '0'" Value="$(GitCommits)-$(GitCommit)-$([System.DateTime]::Now.ToString(yyyyMMddHHmmss))">
<Output TaskParameter="Value" PropertyName="SnapshotName" />
</CreateProperty>
<CreateProperty Condition="'$(GitCommits)' != '0'" Value=".$(GitCommits)">
......@@ -941,7 +944,10 @@
<CreateProperty Condition="'$(Platform)'=='x64'" Value="x64">
<Output TaskParameter="Value" PropertyName="UserFriendlyPlatform" />
</CreateProperty>
<CreateProperty Condition="$(FullVersion) != ''" Value="$(SolutionDir)$(UserFriendlyPlatform)\$(OutputName)-$(FullVersion)$(Revision)$(SnapshotName)-$(UserFriendlyPlatform)-$(Configuration).msi">
<CreateProperty Condition="$(FullVersion) != '' AND '$(GitCommits)' != '0'" Value="$(SolutionDir)$(UserFriendlyPlatform)\$(OutputName)-$(FullVersion)-Dev-$(SnapshotName)-$(UserFriendlyPlatform)$(DebugConfiguration).msi">
<Output TaskParameter="Value" PropertyName="DestinationFileName" />
</CreateProperty>
<CreateProperty Condition="$(FullVersion) != '' AND '$(GitCommits)' == '0'" Value="$(SolutionDir)$(UserFriendlyPlatform)\$(OutputName)-$(FullVersion)-Release-$(UserFriendlyPlatform)$(DebugConfiguration).msi">
<Output TaskParameter="Value" PropertyName="DestinationFileName" />
</CreateProperty>
<CreateProperty Value="$(VCToolsRedistVersion)">
......@@ -969,6 +975,7 @@
<Message Importance="High" Text="VSInstallDir: $(VSInstallDir)" />
<Message Importance="High" Text="SoundsDir: $(SoundsDir)" />
<Message Importance="High" Text="DefineConstants: $(DefineConstants)" />
<Message Importance="High" Text="DestinationFileName: $(DestinationFileName)" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below.
......
......@@ -36,7 +36,7 @@ using Microsoft.Build.Framework;
"Parsing FreeSWITCH version.");
string ConfigureAC = File.ReadAllText(@"$(BaseDir)configure.ac");
string pattern = @"AC_SUBST\((SWITCH_VERSION_[A-Z_]+),.*\[(.?)\]\)";
string pattern = @"AC_SUBST\((SWITCH_VERSION_[A-Z_]+),.*\[(.*)\]\)";
Dictionary<string, string> v = new Dictionary<string, string>();
......@@ -44,9 +44,14 @@ using Microsoft.Build.Framework;
v.Add("SWITCH_VERSION_YEAR", year);
foreach (Match m in Regex.Matches(ConfigureAC, pattern)) {
v.Add(m.Groups[1].Value.Trim(), m.Groups[2].Value.Trim());
string value = m.Groups[2].Value.Trim();
if (value.Contains("-")) {
string[] tokens = value.Split('-');
value = tokens[0];
}
v.Add(m.Groups[1].Value.Trim(), value.Trim());
Log.LogMessage(MessageImportance.High,
m.Groups[1].Value + " = '" + m.Groups[2].Value + "'");
m.Groups[1].Value + " = '" + value.Trim() + "'");
}
//---------------------------------------------------------
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论