[Win] Modify version numbering scheme to support 5-tuple versions
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jul 2014 16:35:17 +0000 (16:35 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jul 2014 16:35:17 +0000 (16:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135400
<rdar://problem/17849033>

Reviewed by David Kilzer.

Source/JavaScriptCore:
* JavaScriptCore.vcxproj/JavaScriptCorePostBuild.cmd: Use the
new version-stamp.pl script to version JavaScriptCore.dll.

Source/WebKit:
* WebKit.vcxproj/WebKit/WebKitPostBuild.cmd: Use the new
version-stamp.pl script to version JavaScriptCore.dll.

Source/WTF:
* WTF.vcxproj/WTFPostBuild.cmd: Use new version-stamp.pl script
to version WTF.dll.
* WTF.vcxproj/WTFPreBuild.cmd: Make sure we have created the
appropriate version resource during builds.

Tools:
Update test cases to recognize that we can only support Major
values from 0-65535, Minor values from 0-64, Tiny values from 0-999,
Micro values from 0-64, and Nano values from 0-999.

* Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl: Update
test expectations for physical limits.

WebKitLibraries:
Revise the auto-version.pl script so that it generates a set of packed
version tuples that allow us to map 5-tuple versions into something
that will work with Windows' 3-tuple version structure.

* win/tools/scripts/auto-version.pl:
(packTwoValues): Added,
(splitVersion): Revised to return packed combination of minor-tiny and
micro-nano to be used as "MINOR" and "TINY" portion of version.
(splitBuildMajorVersion): Deleted.
* win/tools/scripts/version-stamp.pl: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171798 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCorePostBuild.cmd
Source/WTF/ChangeLog
Source/WTF/WTF.vcxproj/WTFPostBuild.cmd
Source/WTF/WTF.vcxproj/WTFPreBuild.cmd
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKit/WebKitPostBuild.cmd
Tools/ChangeLog
Tools/Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl
WebKitLibraries/ChangeLog
WebKitLibraries/win/tools/scripts/auto-version.pl
WebKitLibraries/win/tools/scripts/version-stamp.pl [new file with mode: 0644]

index 391fd19..6238670 100644 (file)
@@ -1,3 +1,14 @@
+2014-07-29  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Modify version numbering scheme to support 5-tuple versions
+        https://bugs.webkit.org/show_bug.cgi?id=135400
+        <rdar://problem/17849033>
+
+        Reviewed by David Kilzer.
+
+        * JavaScriptCore.vcxproj/JavaScriptCorePostBuild.cmd: Use the
+        new version-stamp.pl script to version JavaScriptCore.dll.
+
 2014-07-29  Daniel Bates  <dabates@apple.com>
 
         Use WTF::move() instead of std::move() to help ensure move semantics
index 8b0a3a4..b4d17c7 100644 (file)
@@ -1,2 +1,2 @@
-if exist "%WEBKIT_LIBRARIES%\tools\VersionStamper\VersionStamper.exe" "%WEBKIT_LIBRARIES%\tools\VersionStamper\VersionStamper.exe" --verbose "%TARGETPATH%"
+perl "%WEBKIT_LIBRARIES%\tools\scripts\version-stamp.pl" "%INTDIR%" "%TARGETPATH%"
 if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed"
index b4bd0dc..4f9e3ea 100644 (file)
@@ -1,3 +1,16 @@
+2014-07-29  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Modify version numbering scheme to support 5-tuple versions
+        https://bugs.webkit.org/show_bug.cgi?id=135400
+        <rdar://problem/17849033>
+
+        Reviewed by David Kilzer.
+
+        * WTF.vcxproj/WTFPostBuild.cmd: Use new version-stamp.pl script
+        to version WTF.dll.
+        * WTF.vcxproj/WTFPreBuild.cmd: Make sure we have created the
+        appropriate version resource during builds.
+
 2014-07-29  Daniel Bates  <dabates@apple.com>
 
         Use WTF::move() instead of std::move() to help ensure move semantics
index 7cb7535..4bcbc0b 100644 (file)
@@ -1,2 +1,2 @@
 if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed"
-if exist "%WEBKIT_LIBRARIES%\tools\VersionStamper\VersionStamper.exe" "%WEBKIT_LIBRARIES%\tools\VersionStamper\VersionStamper.exe" --verbose "%TARGETPATH%"
\ No newline at end of file
+perl "%WEBKIT_LIBRARIES%\tools\scripts\version-stamp.pl" "%INTDIR%" "%TARGETPATH%"
index 72ab16a..865b1f2 100644 (file)
@@ -4,3 +4,5 @@ cmd /c
 if exist "%CONFIGURATIONBUILDDIR%\buildfailed" perl -wnle "if (/XX%PROJECTNAME%XX/) { print } else { exit 1 }" "%CONFIGURATIONBUILDDIR%\buildfailed"
 if errorlevel 1 exit 1
 echo XX%PROJECTNAME%XX > "%CONFIGURATIONBUILDDIR%\buildfailed"
+
+perl "%WEBKIT_LIBRARIES%\tools\scripts\auto-version.pl" "%INTDIR%"
index f6279ba..c7d418d 100644 (file)
@@ -1,3 +1,14 @@
+2014-07-29  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Modify version numbering scheme to support 5-tuple versions
+        https://bugs.webkit.org/show_bug.cgi?id=135400
+        <rdar://problem/17849033>
+
+        Reviewed by David Kilzer.
+
+        * WebKit.vcxproj/WebKit/WebKitPostBuild.cmd: Use the new
+        version-stamp.pl script to version JavaScriptCore.dll.
+
 2014-07-17  David Kilzer  <ddkilzer@apple.com>
 
         SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
index b398e1a..b7be195 100644 (file)
@@ -18,6 +18,6 @@ echo Copying resources...
 mkdir "%ResourcesDirectory%" 2>NUL
 xcopy /y /d "%PROJECTDIR%\..\..\win\WebKit.resources\Info.plist" "%ResourcesDirectory%" >NUL
 
-if exist "%WEBKIT_LIBRARIES%\tools\VersionStamper\VersionStamper.exe" "%WEBKIT_LIBRARIES%\tools\VersionStamper\VersionStamper.exe" --verbose "%TARGETPATH%"
+perl "%WEBKIT_LIBRARIES%\tools\scripts\version-stamp.pl" "%INTDIR%" "%TARGETPATH%"
 
 if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed"
index 6781dee..5eaf7e8 100644 (file)
@@ -1,3 +1,18 @@
+2014-07-29  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Modify version numbering scheme to support 5-tuple versions
+        https://bugs.webkit.org/show_bug.cgi?id=135400
+        <rdar://problem/17849033>
+
+        Reviewed by David Kilzer.
+
+        Update test cases to recognize that we can only support Major
+        values from 0-65535, Minor values from 0-64, Tiny values from 0-999,
+        Micro values from 0-64, and Nano values from 0-999.
+
+        * Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl: Update
+        test expectations for physical limits.
+
 2014-07-30  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] GLib tests fail with recent GTK+ due to runtime warning about deprecated properties
index 6e6c0e6..8e52256 100644 (file)
@@ -38,13 +38,13 @@ my @testCases =
             '__VERSION_TEXT__' => '300.4.3.2.1',
             '__BUILD_NUMBER__' => '300.4.3.2.1',
             '__BUILD_NUMBER_SHORT__' => '300.4.3.2.1',
-            '__VERSION_MAJOR__' => '3',
-            '__VERSION_MINOR__' => '00',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MAJOR__' => '300',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '2001',
+            '__VERSION_BUILD__' => '1',
             '__BUILD_NUMBER_MAJOR__' => '300',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '2001',
         },
     },
 
@@ -54,13 +54,13 @@ my @testCases =
             '__VERSION_TEXT__' => '530.4.3.2.1',
             '__BUILD_NUMBER__' => '530.4.3.2.1',
             '__BUILD_NUMBER_SHORT__' => '530.4.3.2.1',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '2001',
+            '__VERSION_BUILD__' => '1',
             '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '2001',
         },
     },
 
@@ -70,13 +70,13 @@ my @testCases =
             '__VERSION_TEXT__' => '53.4.3.2.1',
             '__BUILD_NUMBER__' => '53.4.3.2.1',
             '__BUILD_NUMBER_SHORT__' => '53.4.3.2.1',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '3',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MAJOR__' => '53',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '2001',
+            '__VERSION_BUILD__' => '1',
             '__BUILD_NUMBER_MAJOR__' => '53',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '2001',
         },
     },
 
@@ -87,12 +87,12 @@ my @testCases =
             '__BUILD_NUMBER__' => '5.4.3.2.1',
             '__BUILD_NUMBER_SHORT__' => '5.4.3.2.1',
             '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '2001',
+            '__VERSION_BUILD__' => '1',
             '__BUILD_NUMBER_MAJOR__' => '5',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '2001',
         },
     },
 
@@ -102,13 +102,13 @@ my @testCases =
             '__VERSION_TEXT__' => '300.4.3.2',
             '__BUILD_NUMBER__' => '300.4.3.2',
             '__BUILD_NUMBER_SHORT__' => '300.4.3.2',
-            '__VERSION_MAJOR__' => '3',
-            '__VERSION_MINOR__' => '00',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MAJOR__' => '300',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '2000',
+            '__VERSION_BUILD__' => '2',
             '__BUILD_NUMBER_MAJOR__' => '300',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '2000',
         },
     },
 
@@ -118,13 +118,13 @@ my @testCases =
             '__VERSION_TEXT__' => '530.4.3.2',
             '__BUILD_NUMBER__' => '530.4.3.2',
             '__BUILD_NUMBER_SHORT__' => '530.4.3.2',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '2000',
+            '__VERSION_BUILD__' => '2',
             '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '2000',
         },
     },
 
@@ -134,13 +134,13 @@ my @testCases =
             '__VERSION_TEXT__' => '53.4.3.2',
             '__BUILD_NUMBER__' => '53.4.3.2',
             '__BUILD_NUMBER_SHORT__' => '53.4.3.2',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '3',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MAJOR__' => '53',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '2000',
+            '__VERSION_BUILD__' => '2',
             '__BUILD_NUMBER_MAJOR__' => '53',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '2000',
         },
     },
 
@@ -151,12 +151,12 @@ my @testCases =
             '__BUILD_NUMBER__' => '5.4.3.2',
             '__BUILD_NUMBER_SHORT__' => '5.4.3.2',
             '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '2000',
+            '__VERSION_BUILD__' => '2',
             '__BUILD_NUMBER_MAJOR__' => '5',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '2000',
         },
     },
 
@@ -166,13 +166,13 @@ my @testCases =
             '__VERSION_TEXT__' => '300.4.3',
             '__BUILD_NUMBER__' => '300.4.3',
             '__BUILD_NUMBER_SHORT__' => '300.4.3',
-            '__VERSION_MAJOR__' => '3',
-            '__VERSION_MINOR__' => '00',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MAJOR__' => '300',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '0',
+            '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '300',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '0',
         },
     },
 
@@ -182,13 +182,13 @@ my @testCases =
             '__VERSION_TEXT__' => '530.4.3',
             '__BUILD_NUMBER__' => '530.4.3',
             '__BUILD_NUMBER_SHORT__' => '530.4.3',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '0',
+            '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '0',
         },
     },
 
@@ -198,13 +198,13 @@ my @testCases =
             '__VERSION_TEXT__' => '53.4.3',
             '__BUILD_NUMBER__' => '53.4.3',
             '__BUILD_NUMBER_SHORT__' => '53.4.3',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '3',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MAJOR__' => '53',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '0',
+            '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '53',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '0',
         },
     },
 
@@ -215,12 +215,12 @@ my @testCases =
             '__BUILD_NUMBER__' => '5.4.3',
             '__BUILD_NUMBER_SHORT__' => '5.4.3',
             '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '',
-            '__VERSION_TINY__' => '4',
-            '__VERSION_BUILD__' => '3',
+            '__VERSION_MINOR__' => '4003',
+            '__VERSION_TINY__' => '0',
+            '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '5',
-            '__BUILD_NUMBER_MINOR__' => '4',
-            '__BUILD_NUMBER_VARIANT__' => '3',
+            '__BUILD_NUMBER_MINOR__' => '4003',
+            '__BUILD_NUMBER_VARIANT__' => '0',
         },
     },
 
@@ -230,12 +230,12 @@ my @testCases =
             '__VERSION_TEXT__' => '300.4',
             '__BUILD_NUMBER__' => '300.4',
             '__BUILD_NUMBER_SHORT__' => '300.4',
-            '__VERSION_MAJOR__' => '3',
-            '__VERSION_MINOR__' => '00',
-            '__VERSION_TINY__' => '4',
+            '__VERSION_MAJOR__' => '300',
+            '__VERSION_MINOR__' => '4000',
+            '__VERSION_TINY__' => '0',
             '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '300',
-            '__BUILD_NUMBER_MINOR__' => '4',
+            '__BUILD_NUMBER_MINOR__' => '4000',
             '__BUILD_NUMBER_VARIANT__' => '0',
         },
     },
@@ -246,12 +246,12 @@ my @testCases =
             '__VERSION_TEXT__' => '530.4',
             '__BUILD_NUMBER__' => '530.4',
             '__BUILD_NUMBER_SHORT__' => '530.4',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '4',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '4000',
+            '__VERSION_TINY__' => '0',
             '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '4',
+            '__BUILD_NUMBER_MINOR__' => '4000',
             '__BUILD_NUMBER_VARIANT__' => '0',
         },
     },
@@ -262,12 +262,12 @@ my @testCases =
             '__VERSION_TEXT__' => '53.4',
             '__BUILD_NUMBER__' => '53.4',
             '__BUILD_NUMBER_SHORT__' => '53.4',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '3',
-            '__VERSION_TINY__' => '4',
+            '__VERSION_MAJOR__' => '53',
+            '__VERSION_MINOR__' => '4000',
+            '__VERSION_TINY__' => '0',
             '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '53',
-            '__BUILD_NUMBER_MINOR__' => '4',
+            '__BUILD_NUMBER_MINOR__' => '4000',
             '__BUILD_NUMBER_VARIANT__' => '0',
         },
     },
@@ -279,11 +279,11 @@ my @testCases =
             '__BUILD_NUMBER__' => '5.4',
             '__BUILD_NUMBER_SHORT__' => '5.4',
             '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '',
-            '__VERSION_TINY__' => '4',
+            '__VERSION_MINOR__' => '4000',
+            '__VERSION_TINY__' => '0',
             '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '5',
-            '__BUILD_NUMBER_MINOR__' => '4',
+            '__BUILD_NUMBER_MINOR__' => '4000',
             '__BUILD_NUMBER_VARIANT__' => '0',
         },
     },
@@ -294,8 +294,8 @@ my @testCases =
             '__VERSION_TEXT__' => '300',
             '__BUILD_NUMBER__' => '300',
             '__BUILD_NUMBER_SHORT__' => '300',
-            '__VERSION_MAJOR__' => '3',
-            '__VERSION_MINOR__' => '00',
+            '__VERSION_MAJOR__' => '300',
+            '__VERSION_MINOR__' => '0',
             '__VERSION_TINY__' => '0',
             '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '300',
@@ -310,8 +310,8 @@ my @testCases =
             '__VERSION_TEXT__' => '530',
             '__BUILD_NUMBER__' => '530',
             '__BUILD_NUMBER_SHORT__' => '530',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '0',
             '__VERSION_TINY__' => '0',
             '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '530',
@@ -326,13 +326,13 @@ my @testCases =
             '__VERSION_TEXT__' => '530.1.1.1',
             '__BUILD_NUMBER__' => '530.1.1.1',
             '__BUILD_NUMBER_SHORT__' => '530.1.1.1',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '1',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '1001',
+            '__VERSION_TINY__' => '1000',
             '__VERSION_BUILD__' => '1',
             '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '1',
-            '__BUILD_NUMBER_VARIANT__' => '1',
+            '__BUILD_NUMBER_MINOR__' => '1001',
+            '__BUILD_NUMBER_VARIANT__' => '1000',
         },
     },
 
@@ -342,93 +342,61 @@ my @testCases =
             '__VERSION_TEXT__' => '530.30.20.10',
             '__BUILD_NUMBER__' => '530.30.20.10',
             '__BUILD_NUMBER_SHORT__' => '530.30.20.10',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '30',
-            '__VERSION_BUILD__' => '20',
-            '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '30',
-            '__BUILD_NUMBER_VARIANT__' => '20',
-        },
-    },
-
-    {
-        'RC_ProjectSourceVersion' => '10530.300.200.100',
-        expectedResults => {
-            '__VERSION_TEXT__' => '530.300.200.100',
-            '__BUILD_NUMBER__' => '530.300.200.100',
-            '__BUILD_NUMBER_SHORT__' => '530.300.200.100',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '300',
-            '__VERSION_BUILD__' => '200',
-            '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '300',
-            '__BUILD_NUMBER_VARIANT__' => '200',
-        },
-    },
-
-    {
-        'RC_ProjectSourceVersion' => '10530.3000.2000.1000',
-        expectedResults => {
-            '__VERSION_TEXT__' => '530.3000.2000.1000',
-            '__BUILD_NUMBER__' => '530.3000.2000.1000',
-            '__BUILD_NUMBER_SHORT__' => '530.3000.2000.1000',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '3000',
-            '__VERSION_BUILD__' => '2000',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '30020',
+            '__VERSION_TINY__' => '10000',
+            '__VERSION_BUILD__' => '10',
             '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '3000',
-            '__BUILD_NUMBER_VARIANT__' => '2000',
+            '__BUILD_NUMBER_MINOR__' => '30020',
+            '__BUILD_NUMBER_VARIANT__' => '10000',
         },
     },
 
     {
-        'RC_ProjectSourceVersion' => '7530.3000.2000.1000',
+        'RC_ProjectSourceVersion' => '10530.64.200.64',
         expectedResults => {
-            '__VERSION_TEXT__' => '530.3000.2000.1000',
-            '__BUILD_NUMBER__' => '530.3000.2000.1000',
-            '__BUILD_NUMBER_SHORT__' => '530.3000.2000.1000',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '3000',
-            '__VERSION_BUILD__' => '2000',
+            '__VERSION_TEXT__' => '530.64.200.64',
+            '__BUILD_NUMBER__' => '530.64.200.64',
+            '__BUILD_NUMBER_SHORT__' => '530.64.200.64',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '64200',
+            '__VERSION_TINY__' => '64000',
+            '__VERSION_BUILD__' => '64',
             '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '3000',
-            '__BUILD_NUMBER_VARIANT__' => '2000',
+            '__BUILD_NUMBER_MINOR__' => '64200',
+            '__BUILD_NUMBER_VARIANT__' => '64000',
         },
     },
 
     {
-        'RC_ProjectSourceVersion' => '7530.300.200.100',
+        'RC_ProjectSourceVersion' => '10530.64.999.64',
         expectedResults => {
-            '__VERSION_TEXT__' => '530.300.200.100',
-            '__BUILD_NUMBER__' => '530.300.200.100',
-            '__BUILD_NUMBER_SHORT__' => '530.300.200.100',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '300',
-            '__VERSION_BUILD__' => '200',
+            '__VERSION_TEXT__' => '530.64.999.64',
+            '__BUILD_NUMBER__' => '530.64.999.64',
+            '__BUILD_NUMBER_SHORT__' => '530.64.999.64',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '64999',
+            '__VERSION_TINY__' => '64000',
+            '__VERSION_BUILD__' => '64',
             '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '300',
-            '__BUILD_NUMBER_VARIANT__' => '200',
+            '__BUILD_NUMBER_MINOR__' => '64999',
+            '__BUILD_NUMBER_VARIANT__' => '64000',
         },
     },
 
     {
-        'RC_ProjectSourceVersion' => '7530.30.20.10',
+        'RC_ProjectSourceVersion' => '7530.64.99.10',
         expectedResults => {
-            '__VERSION_TEXT__' => '530.30.20.10',
-            '__BUILD_NUMBER__' => '530.30.20.10',
-            '__BUILD_NUMBER_SHORT__' => '530.30.20.10',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '30',
-            '__VERSION_TINY__' => '30',
-            '__VERSION_BUILD__' => '20',
+            '__VERSION_TEXT__' => '530.64.99.10',
+            '__BUILD_NUMBER__' => '530.64.99.10',
+            '__BUILD_NUMBER_SHORT__' => '530.64.99.10',
+            '__VERSION_MAJOR__' => '530',
+            '__VERSION_MINOR__' => '64099',
+            '__VERSION_TINY__' => '10000',
+            '__VERSION_BUILD__' => '10',
             '__BUILD_NUMBER_MAJOR__' => '530',
-            '__BUILD_NUMBER_MINOR__' => '30',
-            '__BUILD_NUMBER_VARIANT__' => '20',
+            '__BUILD_NUMBER_MINOR__' => '64099',
+            '__BUILD_NUMBER_VARIANT__' => '10000',
         },
     },
 
@@ -439,8 +407,8 @@ my @testCases =
             '__VERSION_TEXT__' => '53',
             '__BUILD_NUMBER__' => '53',
             '__BUILD_NUMBER_SHORT__' => '53',
-            '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '3',
+            '__VERSION_MAJOR__' => '53',
+            '__VERSION_MINOR__' => '0',
             '__VERSION_TINY__' => '0',
             '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '53',
@@ -457,7 +425,7 @@ my @testCases =
             '__BUILD_NUMBER__' => '5',
             '__BUILD_NUMBER_SHORT__' => '5',
             '__VERSION_MAJOR__' => '5',
-            '__VERSION_MINOR__' => '',
+            '__VERSION_MINOR__' => '0',
             '__VERSION_TINY__' => '0',
             '__VERSION_BUILD__' => '0',
             '__BUILD_NUMBER_MAJOR__' => '5',
@@ -468,69 +436,69 @@ my @testCases =
 
     # Largest specified version test
     {
-        'RC_ProjectSourceVersion' => '214747.99.99.99.99',
+        'RC_ProjectSourceVersion' => '214747.64.999.64.999',
         expectedResults => {
-            '__VERSION_TEXT__' => '747.99.99.99.99',
-            '__BUILD_NUMBER__' => '747.99.99.99.99',
-            '__BUILD_NUMBER_SHORT__' => '747.99.99.99.99',
-            '__VERSION_MAJOR__' => '7',
-            '__VERSION_MINOR__' => '47',
-            '__VERSION_TINY__' => '99',
-            '__VERSION_BUILD__' => '99',
+            '__VERSION_TEXT__' => '747.64.999.64.999',
+            '__BUILD_NUMBER__' => '747.64.999.64.999',
+            '__BUILD_NUMBER_SHORT__' => '747.64.999.64.999',
+            '__VERSION_MAJOR__' => '747',
+            '__VERSION_MINOR__' => '64999',
+            '__VERSION_TINY__' => '64999',
+            '__VERSION_BUILD__' => '999',
             '__BUILD_NUMBER_MAJOR__' => '747',
-            '__BUILD_NUMBER_MINOR__' => '99',
-            '__BUILD_NUMBER_VARIANT__' => '99',
+            '__BUILD_NUMBER_MINOR__' => '64999',
+            '__BUILD_NUMBER_VARIANT__' => '64999',
         },
     },
 
     # Leading Whitespace
     {
-        'RC_ProjectSourceVersion' => '        214747.99.99.99.99',
+        'RC_ProjectSourceVersion' => '        214747.64.99.64.99',
         expectedResults => {
-            '__VERSION_TEXT__' => '747.99.99.99.99',
-            '__BUILD_NUMBER__' => '747.99.99.99.99',
-            '__BUILD_NUMBER_SHORT__' => '747.99.99.99.99',
-            '__VERSION_MAJOR__' => '7',
-            '__VERSION_MINOR__' => '47',
-            '__VERSION_TINY__' => '99',
+            '__VERSION_TEXT__' => '747.64.99.64.99',
+            '__BUILD_NUMBER__' => '747.64.99.64.99',
+            '__BUILD_NUMBER_SHORT__' => '747.64.99.64.99',
+            '__VERSION_MAJOR__' => '747',
+            '__VERSION_MINOR__' => '64099',
+            '__VERSION_TINY__' => '64099',
             '__VERSION_BUILD__' => '99',
             '__BUILD_NUMBER_MAJOR__' => '747',
-            '__BUILD_NUMBER_MINOR__' => '99',
-            '__BUILD_NUMBER_VARIANT__' => '99',
+            '__BUILD_NUMBER_MINOR__' => '64099',
+            '__BUILD_NUMBER_VARIANT__' => '64099',
         },
     },
 
     # Trailing Whitespace
     {
-        'RC_ProjectSourceVersion' => '214747.99.99.99.99      ',
+        'RC_ProjectSourceVersion' => '214747.64.99.64.99      ',
         expectedResults => {
-            '__VERSION_TEXT__' => '747.99.99.99.99',
-            '__BUILD_NUMBER__' => '747.99.99.99.99',
-            '__BUILD_NUMBER_SHORT__' => '747.99.99.99.99',
-            '__VERSION_MAJOR__' => '7',
-            '__VERSION_MINOR__' => '47',
-            '__VERSION_TINY__' => '99',
+            '__VERSION_TEXT__' => '747.64.99.64.99',
+            '__BUILD_NUMBER__' => '747.64.99.64.99',
+            '__BUILD_NUMBER_SHORT__' => '747.64.99.64.99',
+            '__VERSION_MAJOR__' => '747',
+            '__VERSION_MINOR__' => '64099',
+            '__VERSION_TINY__' => '64099',
             '__VERSION_BUILD__' => '99',
             '__BUILD_NUMBER_MAJOR__' => '747',
-            '__BUILD_NUMBER_MINOR__' => '99',
-            '__BUILD_NUMBER_VARIANT__' => '99',
+            '__BUILD_NUMBER_MINOR__' => '64099',
+            '__BUILD_NUMBER_VARIANT__' => '64099',
         },
     },
 
     # Leading and Trailing Whitespace
     {
-        'RC_ProjectSourceVersion' => '        214747.99.99.99.99      ',
+        'RC_ProjectSourceVersion' => '        214747.64.99.64.99      ',
         expectedResults => {
-            '__VERSION_TEXT__' => '747.99.99.99.99',
-            '__BUILD_NUMBER__' => '747.99.99.99.99',
-            '__BUILD_NUMBER_SHORT__' => '747.99.99.99.99',
-            '__VERSION_MAJOR__' => '7',
-            '__VERSION_MINOR__' => '47',
-            '__VERSION_TINY__' => '99',
+            '__VERSION_TEXT__' => '747.64.99.64.99',
+            '__BUILD_NUMBER__' => '747.64.99.64.99',
+            '__BUILD_NUMBER_SHORT__' => '747.64.99.64.99',
+            '__VERSION_MAJOR__' => '747',
+            '__VERSION_MINOR__' => '64099',
+            '__VERSION_TINY__' => '64099',
             '__VERSION_BUILD__' => '99',
             '__BUILD_NUMBER_MAJOR__' => '747',
-            '__BUILD_NUMBER_MINOR__' => '99',
-            '__BUILD_NUMBER_VARIANT__' => '99',
+            '__BUILD_NUMBER_MINOR__' => '64099',
+            '__BUILD_NUMBER_VARIANT__' => '64099',
         },
     },
 );
@@ -554,7 +522,7 @@ foreach my $testCase (@testCases) {
     my $expectedResults = $testCase->{expectedResults};
 
     my $outputFile = File::Spec->catfile($testOutputDir, 'include', 'autoversion.h');
-    open(TEST_OUTPUT, '<', $outputFile) or die "Unable to open $outputFile";
+    open(TEST_OUTPUT, '<', $outputFile) or die "Unable to open $outputFile: $!";
 
     while (my $line = <TEST_OUTPUT>) {
         foreach my $expectedResultKey (keys %$expectedResults) {
@@ -571,4 +539,6 @@ foreach my $testCase (@testCases) {
             is($line, $expectedResultValue, "$testCase->{'RC_ProjectSourceVersion'}: $expectedResultKey");
         }
     }
+
+    close(TEST_OUTPUT);
 }
index 111b330..b66906c 100644 (file)
@@ -1,3 +1,22 @@
+2014-07-29  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Modify version numbering scheme to support 5-tuple versions
+        https://bugs.webkit.org/show_bug.cgi?id=135400
+        <rdar://problem/17849033>
+
+        Reviewed by David Kilzer.
+
+        Revise the auto-version.pl script so that it generates a set of packed
+        version tuples that allow us to map 5-tuple versions into something
+        that will work with Windows' 3-tuple version structure.
+
+        * win/tools/scripts/auto-version.pl:
+        (packTwoValues): Added,
+        (splitVersion): Revised to return packed combination of minor-tiny and
+        micro-nano to be used as "MINOR" and "TINY" portion of version.
+        (splitBuildMajorVersion): Deleted.
+        * win/tools/scripts/version-stamp.pl: Added.
+
 2014-07-23  Bem Jones-Bey  <bjonesbe@adobe.com>
 
         Remove CSS_EXCLUSIONS compile flag and leftover code
index 3989dcc..d085f1d 100755 (executable)
@@ -29,7 +29,6 @@ use Win32;
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
 sub splitVersion($);
-sub splitBuildMajorVersion($);
 
 die "You must supply an output path as the argument.\n" if ($#ARGV < 0);
 
@@ -71,11 +70,9 @@ if (!defined $ENVIRONMENT_VERSION) {
 my $PROPOSED_VERSION = (defined $ENVIRONMENT_VERSION) ? $ENVIRONMENT_VERSION : $FALLBACK_VERSION;
 chomp($PROPOSED_VERSION);
 
-my ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION, $ADJUSTED_PROPOSED_VERSION) = splitVersion($PROPOSED_VERSION);
+my ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION, $BUILD_VARIANT_VERSION, $ADJUSTED_PROPOSED_VERSION) = splitVersion($PROPOSED_VERSION);
 
-my ($MAJOR_VERSION, $MINOR_VERSION) = splitBuildMajorVersion($BUILD_MAJOR_VERSION);
-my $TINY_VERSION = $BUILD_MINOR_VERSION;
-my $VARIANT_VERSION = $BUILD_TINY_VERSION;
+my $TINY_VERSION = $BUILD_TINY_VERSION;
 my $VERSION_TEXT = $ADJUSTED_PROPOSED_VERSION;
 my $VERSION_TEXT_SHORT = $VERSION_TEXT;
 
@@ -102,10 +99,10 @@ print OUTPUT_FILE <<EOF;
 #define __VERSION_TEXT__ "$VERSION_TEXT"
 #define __BUILD_NUMBER__ "$VERSION_TEXT"
 #define __BUILD_NUMBER_SHORT__ "$VERSION_TEXT_SHORT"
-#define __VERSION_MAJOR__ $MAJOR_VERSION
-#define __VERSION_MINOR__ $MINOR_VERSION
-#define __VERSION_TINY__ $TINY_VERSION
-#define __VERSION_BUILD__ $VARIANT_VERSION
+#define __VERSION_MAJOR__ $BUILD_MAJOR_VERSION
+#define __VERSION_MINOR__ $BUILD_MINOR_VERSION
+#define __VERSION_TINY__ $BUILD_TINY_VERSION
+#define __VERSION_BUILD__ $BUILD_VARIANT_VERSION
 #define __BUILD_NUMBER_MAJOR__ $BUILD_MAJOR_VERSION
 #define __BUILD_NUMBER_MINOR__ $BUILD_MINOR_VERSION
 #define __BUILD_NUMBER_VARIANT__ $BUILD_TINY_VERSION
@@ -117,6 +114,16 @@ if (defined $COPYRIGHT_END_YEAR) {
 }
 close(OUTPUT_FILE);
 
+sub packTwoValues($$)
+{
+    my $first = shift;
+    my $second = shift;
+
+    die "First version component ($first) is too large. Must be between 0 and 99" if ($first > 99);
+    die "Second version component ($second) is too large. Must be between 0 and 999" if ($second > 999);
+
+    return $first * 1000 + $second;
+}
 
 sub splitVersion($)
 {
@@ -134,11 +141,22 @@ sub splitVersion($)
     # Have the minor and tiny components default to zero if not present.
     my $BUILD_MINOR_VERSION = 0;
     my $BUILD_TINY_VERSION = 0;
+    my $BUILD_MICRO_VERSION = 0;
+    my $BUILD_NANO_VERSION = 0;
     if ($componentCount > 1) {
         $BUILD_MINOR_VERSION = $components[1];
-        if ($componentCount > 2) {
-            $BUILD_TINY_VERSION = $components[2];
-        }
+    }
+    if ($componentCount > 2) {
+        $BUILD_TINY_VERSION = $components[2];
+    }
+    if ($componentCount > 3) {
+        $BUILD_MICRO_VERSION = $components[3];
+    }
+
+    my $RETURN_NANO_VERSION = $BUILD_MICRO_VERSION;
+    if ($componentCount > 4) {
+        $BUILD_NANO_VERSION = $components[4];
+        $RETURN_NANO_VERSION = $BUILD_NANO_VERSION;
     }
 
     # Cut the major component down to three characters by dropping any
@@ -151,25 +169,6 @@ sub splitVersion($)
 
     $PROPOSED_VERSION = substr($PROPOSED_VERSION, $charactersToRemove);
 
-    return ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION, $PROPOSED_VERSION);
+    return ($BUILD_MAJOR_VERSION, packTwoValues($BUILD_MINOR_VERSION, $BUILD_TINY_VERSION), packTwoValues($BUILD_MICRO_VERSION, $BUILD_NANO_VERSION), $RETURN_NANO_VERSION, $PROPOSED_VERSION);
 }
 
-sub splitBuildMajorVersion($)
-{
-    # Split the first component further by using the first digit for the
-    # major version and the remaining two characters as the minor version.
-    # The minor version is shifted down to the tiny version, with the tiny
-    # version becoming the variant version.
-    my ($MAJOR_VERSION, $MINOR_VERSION);
-    {
-        if ($BUILD_MAJOR_VERSION =~ m/^[^\d]*(\d)(\d{1,})/) {
-            $MAJOR_VERSION = $1;
-            $MINOR_VERSION = $2;
-        } else {
-            $MAJOR_VERSION = $BUILD_MAJOR_VERSION;
-            $MINOR_VERSION = '';
-        }
-    }
-
-    return ($MAJOR_VERSION, $MINOR_VERSION);
-}
diff --git a/WebKitLibraries/win/tools/scripts/version-stamp.pl b/WebKitLibraries/win/tools/scripts/version-stamp.pl
new file mode 100644 (file)
index 0000000..f1775b5
--- /dev/null
@@ -0,0 +1,113 @@
+#!/usr/bin/perl -w
+
+use strict;
+use File::Spec;
+
+# Copyright (C) 2007, 2009, 2014 Apple Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sub exitStatus($);
+
+my $WEBKIT_LIBRARIES = $ENV{'WEBKIT_LIBRARIES'};
+
+my $VERSION_STAMPER = File::Spec->catfile($WEBKIT_LIBRARIES, 'tools', 'VersionStamper', 'VersionStamper.exe');
+
+unless (-e $VERSION_STAMPER) {
+    print "No $VERSION_STAMPER executable. Exiting.\n";
+    exit(0);
+}
+
+my ($intdir, $target);
+if (scalar(@ARGV) > 1) {
+    $intdir = $ARGV[0];
+    $target = $ARGV[1];
+} else {
+    my @arguments = split(/\s+/, $ARGV[0]) or die "Couldn't parse $ARGV[0]";
+    die "You must supply the build output directory and the target to be stamped with version information.\n" if (scalar(@arguments) < 2);
+    $intdir = $arguments[0];
+    $target = $arguments[1];
+}
+
+# Make sure we don't have any leading or trailing quote characters.
+$intdir =~ s/^\"//;
+$intdir =~ s/\"$//;
+
+$target =~ s/^\"//;
+$target =~ s/\"$//;
+
+my %components =
+(
+    '__VERSION_TEXT__' => undef,
+    '__VERSION_MAJOR__' => undef,
+    '__VERSION_MINOR__' => undef,
+    '__VERSION_TINY__' => undef,
+    '__VERSION_BUILD__' => undef,
+);
+
+my $VERSION_FILE = File::Spec->catfile(File::Spec->canonpath($intdir), 'include', 'autoversion.h');
+
+open(VERSION_INFO, '<', $VERSION_FILE) or die "Unable to open $VERSION_FILE: $!\n";
+while (my $line = <VERSION_INFO>) {
+    foreach my $componentKey (keys %components) {
+        if ($line !~ m/$componentKey/) {
+            next;
+        }
+
+        $line =~ s/#define $componentKey//;
+        $line =~ s/^\s*(.*)\s*$/$1/;
+        $line =~ s/^"(.*)"$/$1/;
+        chomp($line);
+
+        $components{$componentKey} = $line;
+    }
+}
+close(VERSION_INFO);
+
+print "Processing version $components{'__VERSION_TEXT__'} for $target\n";
+
+my $TARGET_PATH = File::Spec->canonpath($target);
+
+my $rc = system($VERSION_STAMPER, '--verbose', $TARGET_PATH, '--fileMajor', $components{'__VERSION_MAJOR__'},
+    '--fileMinor', $components{'__VERSION_MINOR__'}, '--fileRevision', $components{'__VERSION_TINY__'},
+    '--fileBuild', $components{'__VERSION_BUILD__'}, '--productMajor', $components{'__VERSION_MAJOR__'},
+    '--productMinor', $components{'__VERSION_MINOR__'}, '--productRevision', $components{'__VERSION_TINY__'},
+    '--productBuild', $components{'__VERSION_BUILD__'}); 
+
+exit(exitStatus($rc));
+
+# This method is for portability. Return the system-appropriate exit
+# status of a child process.
+#
+# Args: pass the child error status returned by the last pipe close,
+#       for example "$?".
+sub exitStatus($)
+{
+    my ($returnvalue) = @_;
+    if ($^O eq "MSWin32") {
+        return $returnvalue >> 8;
+    }
+    if (!WIFEXITED($returnvalue)) {
+        return 254;
+    }
+    return WEXITSTATUS($returnvalue);
+}