You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Brief
Even if a file already contains right copyright header, the 'licenseheaders.py' script overrides file with the same content making build system treat this file as "changed" and recompile it again.
Details
Suppose we have a C++ codebase where all files already have right copyright headers. After we apply a 'licenseheaders.py' script, the C++ build system will treat all C++ files as "changed" even if there were no changes introduced, which will lead to recompilation of whole code base.
Because of that it is not practical to use the 'licenseheaders.py' script as a prebuild event.
Possible solution
The algorithm to ensure that the script touches files only when it is needed:
Write output to the temporary file
If temporary file is different from the original (it means that the copyright header has been updated) replace the original file with the temporary one
The text was updated successfully, but these errors were encountered:
Good point, thanks for reporting!
(Never thought of this getting used as a prebuild-task :D )
It should be possible to do this without writing to a temporary file and comparing, as long as we assume that all files processed will fit into memory.
Brief
Even if a file already contains right copyright header, the 'licenseheaders.py' script overrides file with the same content making build system treat this file as "changed" and recompile it again.
Details
Suppose we have a C++ codebase where all files already have right copyright headers. After we apply a 'licenseheaders.py' script, the C++ build system will treat all C++ files as "changed" even if there were no changes introduced, which will lead to recompilation of whole code base.
Because of that it is not practical to use the 'licenseheaders.py' script as a prebuild event.
Possible solution
The algorithm to ensure that the script touches files only when it is needed:
The text was updated successfully, but these errors were encountered: