[Win] Version stamp should include package-level version
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Aug 2014 23:45:34 +0000 (23:45 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Aug 2014 23:45:34 +0000 (23:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136266
<rdar://problem/18134138>

Reviewed by David Kilzer.

Tools:

* Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl: Add
tests for the full 3+ digit version.
* Scripts/webkitperl/auto-version_unittest/versionStampTests.pl:
Confirm that the final output DLL uses the 3+ digit version.

WebKitLibraries:

* win/tools/scripts/auto-version.pl: Retain the full major build
version in addition to the three-digit value we use internally.
* win/tools/scripts/version-stamp.pl: Find and use the full 3+ digit
major build version when stamping the final output file.

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

Tools/ChangeLog
Tools/Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl
Tools/Scripts/webkitperl/auto-version_unittest/versionStampTests.pl
WebKitLibraries/ChangeLog
WebKitLibraries/win/tools/scripts/auto-version.pl
WebKitLibraries/win/tools/scripts/version-stamp.pl

index ab83866..2260dd7 100644 (file)
@@ -1,5 +1,18 @@
 2014-08-26  Brent Fulgham  <bfulgham@apple.com>
 
+        [Win] Version stamp should include package-level version
+        https://bugs.webkit.org/show_bug.cgi?id=136266
+        <rdar://problem/18134138>
+
+        Reviewed by David Kilzer.
+
+        * Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl: Add
+        tests for the full 3+ digit version.
+        * Scripts/webkitperl/auto-version_unittest/versionStampTests.pl:
+        Confirm that the final output DLL uses the 3+ digit version.
+
+2014-08-26  Brent Fulgham  <bfulgham@apple.com>
+
         [Win] WebKit IDL incorrectly passes HWND as OLE_HANDLE
         https://bugs.webkit.org/show_bug.cgi?id=136258
         <rdar://problem/18134138>
index 97c9e9f..0b3ad94 100644 (file)
@@ -45,6 +45,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '300',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2001',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5300',
         },
     },
 
@@ -61,6 +62,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2001',
+            '__FULL_BUILD_MAJOR_VERSION__' => '530',
         },
     },
 
@@ -77,6 +79,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '53',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2001',
+            '__FULL_BUILD_MAJOR_VERSION__' => '53',
         },
     },
 
@@ -93,6 +96,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '5',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2001',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5',
         },
     },
 
@@ -109,6 +113,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '300',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2000',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5300',
         },
     },
 
@@ -125,6 +130,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2000',
+            '__FULL_BUILD_MAJOR_VERSION__' => '530',
         },
     },
 
@@ -141,6 +147,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '53',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2000',
+            '__FULL_BUILD_MAJOR_VERSION__' => '53',
         },
     },
 
@@ -157,6 +164,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '5',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2000',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5',
         },
     },
 
@@ -173,6 +181,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '300',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5300',
         },
     },
 
@@ -189,6 +198,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '530',
         },
     },
 
@@ -205,6 +215,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '53',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '53',
         },
     },
 
@@ -221,6 +232,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '5',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5',
         },
     },
 
@@ -237,6 +249,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '300',
             '__BUILD_NUMBER_MINOR__' => '4000',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5300',
         },
     },
 
@@ -253,6 +266,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '4000',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '530',
         },
     },
 
@@ -269,6 +283,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '53',
             '__BUILD_NUMBER_MINOR__' => '4000',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '53',
         },
     },
 
@@ -285,6 +300,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '5',
             '__BUILD_NUMBER_MINOR__' => '4000',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5',
         },
     },
 
@@ -301,6 +317,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '300',
             '__BUILD_NUMBER_MINOR__' => '0',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5300',
         },
     },
 
@@ -317,6 +334,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '0',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '530',
         },
     },
 
@@ -333,6 +351,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '1001',
             '__BUILD_NUMBER_VARIANT__' => '1000',
+            '__FULL_BUILD_MAJOR_VERSION__' => '10530',
         },
     },
 
@@ -349,6 +368,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '30020',
             '__BUILD_NUMBER_VARIANT__' => '10000',
+            '__FULL_BUILD_MAJOR_VERSION__' => '10530',
         },
     },
 
@@ -365,6 +385,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '64200',
             '__BUILD_NUMBER_VARIANT__' => '64000',
+            '__FULL_BUILD_MAJOR_VERSION__' => '10530',
         },
     },
 
@@ -381,6 +402,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '64999',
             '__BUILD_NUMBER_VARIANT__' => '64000',
+            '__FULL_BUILD_MAJOR_VERSION__' => '10530',
         },
     },
 
@@ -397,6 +419,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '530',
             '__BUILD_NUMBER_MINOR__' => '64099',
             '__BUILD_NUMBER_VARIANT__' => '10000',
+            '__FULL_BUILD_MAJOR_VERSION__' => '7530',
         },
     },
 
@@ -414,6 +437,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '53',
             '__BUILD_NUMBER_MINOR__' => '0',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '53',
         },
     },
 
@@ -431,6 +455,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '5',
             '__BUILD_NUMBER_MINOR__' => '0',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5',
         },
     },
 
@@ -448,6 +473,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '747',
             '__BUILD_NUMBER_MINOR__' => '64999',
             '__BUILD_NUMBER_VARIANT__' => '64999',
+            '__FULL_BUILD_MAJOR_VERSION__' => '214747',
         },
     },
 
@@ -465,6 +491,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '747',
             '__BUILD_NUMBER_MINOR__' => '64099',
             '__BUILD_NUMBER_VARIANT__' => '64099',
+            '__FULL_BUILD_MAJOR_VERSION__' => '214747',
         },
     },
 
@@ -482,6 +509,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '747',
             '__BUILD_NUMBER_MINOR__' => '64099',
             '__BUILD_NUMBER_VARIANT__' => '64099',
+            '__FULL_BUILD_MAJOR_VERSION__' => '214747',
         },
     },
 
@@ -499,6 +527,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '747',
             '__BUILD_NUMBER_MINOR__' => '64099',
             '__BUILD_NUMBER_VARIANT__' => '64099',
+            '__FULL_BUILD_MAJOR_VERSION__' => '214747',
         },
     },
 
@@ -518,6 +547,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '600',
             '__BUILD_NUMBER_MINOR__' => '1000',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '7600',
         },
     },
 
@@ -535,6 +565,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '27',
             '__BUILD_NUMBER_MINOR__' => '0',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '27',
         },
     },
 
@@ -552,6 +583,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '27',
             '__BUILD_NUMBER_MINOR__' => '0',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '27',
         },
     },
 
@@ -569,6 +601,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '27',
             '__BUILD_NUMBER_MINOR__' => '0',
             '__BUILD_NUMBER_VARIANT__' => '0',
+            '__FULL_BUILD_MAJOR_VERSION__' => '27',
         },
     },
 
@@ -586,6 +619,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '300',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2001',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5300',
         },
     },
 
@@ -603,6 +637,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '300',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2001',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5300',
         },
     },
 
@@ -620,6 +655,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '300',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2001',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5300',
         },
     },
 
@@ -637,6 +673,7 @@ my @testCases =
             '__BUILD_NUMBER_MAJOR__' => '300',
             '__BUILD_NUMBER_MINOR__' => '4003',
             '__BUILD_NUMBER_VARIANT__' => '2001',
+            '__FULL_BUILD_MAJOR_VERSION__' => '5300',
         },
     },
 );
@@ -648,7 +685,7 @@ if ($^O ne 'MSWin32' && $^O ne 'cygwin') {
     exit 0;    
 }
 
-my $testCasesCount = scalar(@testCases) * 10; # 10 expected results
+my $testCasesCount = scalar(@testCases) * 11; # 11 expected results
 plan(tests => $testCasesCount);
 
 foreach my $testCase (@testCases) {
index 5cc13b8..089209d 100755 (executable)
@@ -35,15 +35,15 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '5300.4.3.2.1',
         'RC_PROJECTBUILDVERSION' => undef,
-        expectedVersionResult => '300.4003.2001',
-        expectedBuildVersionResult => 1,
+        'expectedVersionResult' => '5300.4003.2001',
+        'expectedBuildVersionResult' => 1,
     },
 
     {
         'RC_ProjectSourceVersion' => '5300.4.3.2.1',
         'RC_PROJECTBUILDVERSION' => 156,
-        expectedVersionResult => '300.4003.2001',
-        expectedBuildVersionResult => 156,
+        'expectedVersionResult' => '5300.4003.2001',
+        'expectedBuildVersionResult' => 156,
     },
 );
 
index 263633d..908d892 100644 (file)
@@ -1,3 +1,17 @@
+2014-08-26  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Version stamp should include package-level version
+        https://bugs.webkit.org/show_bug.cgi?id=136266
+        <rdar://problem/18134138>
+
+        Reviewed by David Kilzer.
+
+        * win/tools/scripts/auto-version.pl: Retain the full major build
+        version in addition to the three-digit value we use internally.
+        * win/tools/scripts/version-stamp.pl: Find and use the full 3+ digit
+        major build version when stamping the final output file.
+
+
 2014-08-25  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Pass OFFICIAL_BUILD flag to WebInspectorUI build process
index b38c480..5f7c980 100755 (executable)
@@ -66,7 +66,7 @@ my $ENVIRONMENT_VERSION = $ENV{'RC_ProjectSourceVersion'} || $ENV{'RC_PROJECTSOU
 my $PROPOSED_VERSION = $ENVIRONMENT_VERSION || $FALLBACK_VERSION;
 chomp($PROPOSED_VERSION);
 
-my ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION, $BUILD_VARIANT_VERSION, $ADJUSTED_PROPOSED_VERSION) = splitVersion($PROPOSED_VERSION);
+my ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION, $BUILD_VARIANT_VERSION, $ADJUSTED_PROPOSED_VERSION, $FULL_BUILD_MAJOR_VERSION) = splitVersion($PROPOSED_VERSION);
 
 my $TINY_VERSION = $BUILD_TINY_VERSION;
 my $VERSION_TEXT = $ADJUSTED_PROPOSED_VERSION;
@@ -103,6 +103,7 @@ print OUTPUT_FILE <<EOF;
 #define __BUILD_NUMBER_MINOR__ $BUILD_MINOR_VERSION
 #define __BUILD_NUMBER_VARIANT__ $BUILD_TINY_VERSION
 #define __SVN_REVISION__ $SVN_REVISION
+#define __FULL_BUILD_MAJOR_VERSION__  $FULL_BUILD_MAJOR_VERSION
 EOF
 
 if (defined $COPYRIGHT_END_YEAR) {
@@ -159,11 +160,12 @@ sub splitVersion($)
     # extra leading digits, then adjust the major version portion of the
     # version string to match.
     my $originalLength = length($BUILD_MAJOR_VERSION);
+    my $FULL_BUILD_MAJOR_VERSION = $BUILD_MAJOR_VERSION;
     $BUILD_MAJOR_VERSION =~ s/^.*(\d\d\d)$/$1/;
 
     my $charactersToRemove = $originalLength - length($BUILD_MAJOR_VERSION);
 
     $PROPOSED_VERSION = substr($PROPOSED_VERSION, $charactersToRemove);
 
-    return ($BUILD_MAJOR_VERSION, packTwoValues($BUILD_MINOR_VERSION, $BUILD_TINY_VERSION), packTwoValues($BUILD_MICRO_VERSION, $BUILD_NANO_VERSION), $RETURN_NANO_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, $FULL_BUILD_MAJOR_VERSION);
 }
index 967bb6c..7e023c5 100644 (file)
@@ -63,6 +63,7 @@ my %components =
     '__VERSION_MINOR__' => undef,
     '__VERSION_TINY__' => undef,
     '__VERSION_BUILD__' => undef,
+    '__FULL_BUILD_MAJOR_VERSION__' => undef,
 );
 
 my $VERSION_FILE = File::Spec->catfile(File::Spec->canonpath($intdir), 'include', 'autoversion.h');
@@ -90,7 +91,7 @@ my $TARGET_PATH = File::Spec->canonpath($target);
 
 print "Adjusting RC_PROJECTSOURCEVERSION and RC_ProjectSourceVersion to be safe for VersionStamper.\n";
 
-my $SAFE_PROJECT_VERSION = "$components{'__VERSION_MAJOR__'}.$components{'__VERSION_MINOR__'}.$components{'__VERSION_TINY__'}";
+my $SAFE_PROJECT_VERSION = "$components{'__FULL_BUILD_MAJOR_VERSION__'}.$components{'__VERSION_MINOR__'}.$components{'__VERSION_TINY__'}";
 my $SAFE_BUILD_VERSION = $ENV{RC_ProjectBuildVersion} || $ENV{RC_PROJECTBUILDVERSION} || $components{'__VERSION_BUILD__'};
 
 print "Using RC_PROJECTSOURCEVERSION=$SAFE_PROJECT_VERSION and RC_PROJECTBUILDVERSION=$SAFE_BUILD_VERSION\n";
@@ -99,9 +100,9 @@ print "Using RC_PROJECTSOURCEVERSION=$SAFE_PROJECT_VERSION and RC_PROJECTBUILDVE
 $ENV{RC_PROJECTSOURCEVERSION} = $SAFE_PROJECT_VERSION;
 $ENV{RC_ProjectSourceVersion} = $SAFE_PROJECT_VERSION;
 
-my $rc = system($VERSION_STAMPER, '--verbose', $TARGET_PATH, '--fileMajor', $components{'__VERSION_MAJOR__'},
+my $rc = system($VERSION_STAMPER, '--verbose', $TARGET_PATH, '--fileMajor', $components{'__FULL_BUILD_MAJOR_VERSION__'},
     '--fileMinor', $components{'__VERSION_MINOR__'}, '--fileRevision', $components{'__VERSION_TINY__'},
-    '--fileBuild', $SAFE_BUILD_VERSION, '--productMajor', $components{'__VERSION_MAJOR__'},
+    '--fileBuild', $SAFE_BUILD_VERSION, '--productMajor', $components{'__FULL_BUILD_MAJOR_VERSION__'},
     '--productMinor', $components{'__VERSION_MINOR__'}, '--productRevision', $components{'__VERSION_TINY__'},
     '--productBuild', $components{'__VERSION_BUILD__'});