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
<Exec Command="$(SolutionDir)w32\Setup\FullVersion.cmd" ConsoleToMSBuild="true">\r
<Output TaskParameter="ConsoleOutput" PropertyName="FullVersion" />\r
</Exec>\r
- <CreateProperty Condition="'$(GitCommits)' != '0'" Value="-snapshot-$(GitCommit)-$([System.DateTime]::Now.ToString(yyyyMMddHHmmss))">\r
+ <CreateProperty Condition="'$(Configuration)' == 'Debug'" Value="-debug">\r
+ <Output TaskParameter="Value" PropertyName="DebugConfiguration" />\r
+ </CreateProperty>\r
+ <CreateProperty Condition="'$(GitCommits)' != '0'" Value="$(GitCommits)-$(GitCommit)-$([System.DateTime]::Now.ToString(yyyyMMddHHmmss))">\r
<Output TaskParameter="Value" PropertyName="SnapshotName" />\r
</CreateProperty>\r
<CreateProperty Condition="'$(GitCommits)' != '0'" Value=".$(GitCommits)">\r
<CreateProperty Condition="'$(Platform)'=='x64'" Value="x64">\r
<Output TaskParameter="Value" PropertyName="UserFriendlyPlatform" />\r
</CreateProperty>\r
- <CreateProperty Condition="$(FullVersion) != ''" Value="$(SolutionDir)$(UserFriendlyPlatform)\$(OutputName)-$(FullVersion)$(Revision)$(SnapshotName)-$(UserFriendlyPlatform)-$(Configuration).msi">\r
+ <CreateProperty Condition="$(FullVersion) != '' AND '$(GitCommits)' != '0'" Value="$(SolutionDir)$(UserFriendlyPlatform)\$(OutputName)-$(FullVersion)-Dev-$(SnapshotName)-$(UserFriendlyPlatform)$(DebugConfiguration).msi">\r
+ <Output TaskParameter="Value" PropertyName="DestinationFileName" />\r
+ </CreateProperty>\r
+ <CreateProperty Condition="$(FullVersion) != '' AND '$(GitCommits)' == '0'" Value="$(SolutionDir)$(UserFriendlyPlatform)\$(OutputName)-$(FullVersion)-Release-$(UserFriendlyPlatform)$(DebugConfiguration).msi">\r
<Output TaskParameter="Value" PropertyName="DestinationFileName" />\r
</CreateProperty>\r
<CreateProperty Value="$(VCToolsRedistVersion)">\r
<Message Importance="High" Text="VSInstallDir: $(VSInstallDir)" />\r
<Message Importance="High" Text="SoundsDir: $(SoundsDir)" />\r
<Message Importance="High" Text="DefineConstants: $(DefineConstants)" />\r
+ <Message Importance="High" Text="DestinationFileName: $(DestinationFileName)" />\r
</Target>\r
<!--
To modify your build process, add your task inside one of the targets below.
"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>();
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() + "'");
}
//---------------------------------------------------------