Class StaleFilesCollector


  • public class StaleFilesCollector
    extends Object
    IMPORTANT Use of this class is discouraged. The class is informed about FS changes walks FS to find out existing files and report those unchanged as stale. As a drawback, need an external mechanism to tell non-generated files under generated location. MPS doesn't use it for TextGen as we record names of generated files and don't need to walk FS any more
    • Constructor Detail

      • StaleFilesCollector

        public StaleFilesCollector​(IFile rootDir)
    • Method Detail

      • recordGeneratedChildren

        public void recordGeneratedChildren​(GenerationDependenciesCache genDeps,
                                            SModel model)
        Read cached state of generated files, if any, assuming files were generated under rootDir. The code is intended to handle case when we generate into a root with foreign files we shall keep. Generally, all the files under rootDir might need deletion (except those explicitly written/kept). Files left after excluding those touched are additionally filtered through 'foreign' roots in a way that we consider only generated files under output root (intersect in getChildren).
      • recordFilesToKeep

        public void recordFilesToKeep​(FilesDelta delta)
        May be invoked multiple times, updates internal state of what files are considered 'touched' according to delta supplied These files are not reported as 'stale' by reportStaleFilesInto(FilesDelta)
      • reportStaleFilesInto

        public void reportStaleFilesInto​(FilesDelta delta)
      • updateDelta

        @Deprecated
        public void updateDelta​(FilesDelta delta)
        Deprecated.
        This method assumes there's no other delta for the root other than passed as an argument, which is wrong for forked generation plans with multiple models that save output into the same location. Then there are few deltas reported for the same location, some reporting files as stale while other report as added