def __fetch_includes(self, target_name, in_filename, include_dirs, compiler_flags): ui.debug("getting includes for " + in_filename) with ui.ident: cache_file = self.cache_directory(target_name) + in_filename + ".includes" includes = None if os.path.exists(cache_file) and fsutils.is_newer_than(cache_file, in_filename): includes = marshal.load(open(cache_file, "rb")) else: fsutils.mkdir_recursive(os.path.dirname(cache_file)); includes = self.__scan_includes(in_filename, include_dirs, compiler_flags) marshal.dump(includes, open(cache_file, "wb")) return includes
def __fetch_includes(self, target_name, in_filename, include_dirs, compiler_flags): ui.debug("getting includes for " + in_filename) with ui.ident: cache_file = self.cache_directory( target_name) + in_filename + ".includes" includes = None if os.path.exists(cache_file) and fsutils.is_newer_than( cache_file, in_filename): includes = marshal.load(open(cache_file, "rb")) else: fsutils.mkdir_recursive(os.path.dirname(cache_file)) includes = self.__scan_includes(in_filename, include_dirs, compiler_flags) marshal.dump(includes, open(cache_file, "wb")) return includes
def is_newer_than_target(filename): if os.path.exists(filename): # TODO: proper appname return fsutils.is_newer_than(filename, target)