diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-02 15:32:50 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-02 15:53:55 -0300 |
commit | 4b787fb7d1af5a0f764e9a75f36eaa34c64fe237 (patch) | |
tree | a04dcefa793159a08aa4ceea4c7b3eb73391091f /scripts/gendeclarations.lua | |
parent | cab8cf970c09ea465d30e11eb356e2e5d37dc544 (diff) | |
download | rneovim-4b787fb7d1af5a0f764e9a75f36eaa34c64fe237.tar.gz rneovim-4b787fb7d1af5a0f764e9a75f36eaa34c64fe237.tar.bz2 rneovim-4b787fb7d1af5a0f764e9a75f36eaa34c64fe237.zip |
Make gendeclarations.lua more friendly to incremental builds
Modify gendeclarations.lua to check if the generated non-static declaration
header changed before rewriting it with a new version. This is to prevent
unnecessary rebuilds of modules that depend on modules that had private changes.
Diffstat (limited to 'scripts/gendeclarations.lua')
-rwxr-xr-x | scripts/gendeclarations.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/gendeclarations.lua b/scripts/gendeclarations.lua index 311ed8b527..76711cc214 100755 --- a/scripts/gendeclarations.lua +++ b/scripts/gendeclarations.lua @@ -227,6 +227,18 @@ F = io.open(static_fname, 'w') F:write(static) F:close() +-- Before generating the non-static headers, check if the current file(if +-- exists) is different from the new one. If they are the same, we won't touch +-- the current version to avoid triggering an unnecessary rebuilds of modules +-- that depend on this one +F = io.open(non_static_fname, 'r') +if F ~= nil then + if F:read('*a') == non_static then + os.exit(0) + end + io.close(F) +end + F = io.open(non_static_fname, 'w') F:write(non_static) F:close() |