]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11513: [Build-System] Fix Windows versioning.
authorAndrey Volk <andywolk@gmail.com>
Tue, 16 Jul 2019 18:23:38 +0000 (22:23 +0400)
committerAndrey Volk <andywolk@gmail.com>
Tue, 16 Jul 2019 18:23:38 +0000 (22:23 +0400)
w32/Setup/FullVersion.cmd
w32/Setup/Setup.2017.wixproj
w32/switch_version.props

index 5cbec6a7e2a9bd3cb549cf6fa5476f0a6bffccd5..f98ee7360b1b7b62dca94ce81184a8ea3d8b6738 100644 (file)
@@ -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
index db9b628d61ffe47619c0db932cba018518452cb8..e740dc05212e6904f0af1b8d231049367cd07f7b 100644 (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.
index 4825ff7bd90126591393e1a52089fbfc6b7fd2bc..c01de029ec2b711f032102b5b33f6ecc108695e8 100644 (file)
@@ -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() + "'");                    
             }
             
             //---------------------------------------------------------