haskell - How to delete unbuildable goal? -
i remove files no longer have source without cleaning.
is there support partially cleaning incremental build? in case, guess compare against set of source files consumed in previous builds , define how clean gone.
main = shakeargs shakeoptions { shakeverbosity = diagnostic } $ want [".build"] phony ".build" $ files <- getdirectoryfiles "." ["//*.txt"] let goals = map (-<.> "") files need goals "*" %> \out -> stdout o <- cmd $ "sort " ++ (out ++ ".txt") writefile' out o
using shakeargsprune can define function gets passed live files afterwards. can write like:
import development.shake import development.shake.filepath import development.shake.util import system.directory.extra import data.list import system.io pruner :: [filepath] -> io () pruner live = present <- listfilesrecursive "output" mapm_ removefile $ map tostandard present \\ map tostandard live main :: io () main = shakeargsprune shakeoptions pruner $ ... rules go here ... this deletes files in output not generated , up-to-date according build system stands. complete example see http://neilmitchell.blogspot.co.uk/2015/04/cleaning-stale-files-with-shake.html.
the shakeargsprune function available in shake-0.15.1 , above, based on shakelivefiles feature has been available longer , can used directly if desire.
Comments
Post a Comment