Create Compilation files only when something changes

Issue #4 new
Former user created an issue

as the title says ... msvc2013 will rebuild stuff everytime as it thinks that file is newer

so do not open a file just put the content in a string and double check at the end if stuff changed

again ...too (busy) lazy to push a proper request

index = 1
        table.foreachi(unitfilenames, function(fileName)
            local file = io.open(fileName, "r")
            local content = file:read("*all")  
            file:close()
            if content ~= unitfiles[index] then
                local file = io.open(fileName, "w")
                file:write(unitfiles[index])
                file:close()
            end         

            index = index + 1
        end) 

Comments (5)

  1. Damien Courtois repo owner

    Hi, What you say should only happen if you re-create the solution through premake, right ? Once the compilation files are generated (during the generation of the project) they are (should) never modified, right ? I assumed that you only run Premake when one or more files have been added / removed and / or some configurations changed. And in this case, re-building the generated compilation units made sense (well most of the time)

    If you would explain me your workflow, maybe I would better see the problem

  2. Former user Account Deleted reporter

    the workflow is simple .because the programmers forget to commit the projects everytime they regenerate them, the build server (which is olso the main client for the CU ) will regenerate them everytime there is a change in the SCM ..just to make sure they are uptodate. This means that the files are written and the timestamp changed so they will be compiled again ... :)

  3. Damien Courtois repo owner

    Ok I understand now. Will add this when I find the time (as usual :p) Thanks for the issues !

  4. Log in to comment