| 188 | } |
| 189 | |
| 190 | static void UpdateFile(const ScriptFile* parent_script_file, ScriptFile& file, const std::string& source, const Path& path) { |
| 191 | file.parent = parent_script_file; |
| 192 | file.unexpanded_contents = source; |
| 193 | file.contents = source; |
| 194 | file.file_path = path; |
| 195 | file.dependencies.clear(); |
| 196 | file.dependencies.resize(1); |
| 197 | file.dependencies[0].path = path; |
| 198 | file.dependencies[0].modified = GetDateModifiedInt64(path); |
| 199 | file.ExpandIncludePaths(); |
| 200 | file.hash = djb2_string_hash(file.contents.c_str()); |
| 201 | std::vector<Dependency>::iterator iter = file.dependencies.begin(); |
| 202 | file.latest_modification = (*iter).modified; |
| 203 | ++iter; |
| 204 | for (; iter != file.dependencies.end(); ++iter) { |
| 205 | file.latest_modification = max(file.latest_modification, (*iter).modified); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | static const ScriptFile* GetScriptFileRecursive(const ScriptFile* parent_script_file, const Path& path) { |
| 210 | // Look in script file cache for desired script file |
no test coverage detected