Changeset 128966 in webkit
- Timestamp:
- Sep 18, 2012 10:41:20 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r128943 r128966 1 2012-09-18 Kangil Han <kangil.han@samsung.com> 2 3 [WK2][WTR] CodeGeneratorTestRunner could keep original copyright. 4 https://bugs.webkit.org/show_bug.cgi?id=96181 5 6 Reviewed by Daniel Bates. 7 8 This patch enabled derived files, in DerivedSources/InjectedBundle, to keep original copyright. 9 10 * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm: 11 (new): 12 (_parseLicenseBlock): 13 (_parseLicenseBlockFromFile): 14 (_defaultLicenseBlock): 15 (_licenseBlock): 16 (_generateHeaderFile): 17 (_generateImplementationFile): 18 1 19 2012-09-18 Byungwoo Lee <bw80.lee@samsung.com> 2 20 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
r128108 r128966 1 1 # Copyright (C) 2010 Apple Inc. All rights reserved. 2 # Copyright (C) 2012 Samsung Electronics 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 30 31 sub new 31 32 { 32 my ($class, $codeGenerator, $outputDir ) = @_;33 my ($class, $codeGenerator, $outputDir, $outputHeaderDir, $layerOnTop, $preprocessor, $writeDependencies, $verbose, $idlFilePath) = @_; 33 34 34 35 my $reference = { 35 36 codeGenerator => $codeGenerator, 36 37 outputDir => $outputDir, 38 idlFilePath => $idlFilePath, 37 39 }; 38 40 … … 73 75 } 74 76 75 sub _fileHeaderString 76 { 77 my ($filename) = @_; 78 79 # FIXME: We should pull header out of the IDL file to get the copyright 80 # year(s) right. 77 sub _parseLicenseBlock 78 { 79 my ($fileHandle) = @_; 80 81 my ($copyright, $readCount, $buffer, $currentCharacter, $previousCharacter); 82 my $startSentinel = "/*"; 83 my $lengthOfStartSentinel = length($startSentinel); 84 $readCount = read($fileHandle, $buffer, $lengthOfStartSentinel); 85 return "" if ($readCount < $lengthOfStartSentinel || $buffer ne $startSentinel); 86 $copyright = $buffer; 87 88 while ($readCount = read($fileHandle, $currentCharacter, 1)) { 89 $copyright .= $currentCharacter; 90 return $copyright if $currentCharacter eq "/" && $previousCharacter eq "*"; 91 $previousCharacter = $currentCharacter; 92 } 93 94 return ""; 95 } 96 97 sub _parseLicenseBlockFromFile 98 { 99 my ($path) = @_; 100 open my $fileHandle, "<", $path or die "Failed to open $path for reading: $!"; 101 my $licenseBlock = _parseLicenseBlock($fileHandle); 102 close($fileHandle); 103 return $licenseBlock; 104 } 105 106 sub _defaultLicenseBlock 107 { 81 108 return <<EOF; 82 109 /* … … 107 134 } 108 135 136 sub _licenseBlock 137 { 138 my ($self) = @_; 139 return $self->{licenseBlock} if $self->{licenseBlock}; 140 141 my $licenseBlock = _parseLicenseBlockFromFile($self->{idlFilePath}) || _defaultLicenseBlock(); 142 $self->{licenseBlock} = $licenseBlock; 143 return $licenseBlock; 144 } 145 109 146 sub _generateHeaderFile 110 147 { … … 118 155 my $filename = $className . ".h"; 119 156 120 push(@contents, _fileHeaderString($filename));157 push(@contents, $self->_licenseBlock()); 121 158 122 159 my $parentClassName = _parentClassName($interface); … … 185 222 my $filename = $className . ".cpp"; 186 223 187 push(@contentsPrefix, _fileHeaderString($filename));224 push(@contentsPrefix, $self->_licenseBlock()); 188 225 189 226 my $classRefGetter = $self->_classRefGetter($idlType);
Note: See TracChangeset
for help on using the changeset viewer.