public override bool Execute() { PrepareExecute(); var cacheItemSpec = PropertyCache.ItemSpec; Utilities.RequireAbsolutePath(cacheItemSpec, nameof(PropertyCache)); var currentHash = HashSettings(); bool writeNeeded; if (File.Exists(cacheItemSpec)) { ReadOnlySpan <byte> currentHashSpan = currentHash; ReadOnlySpan <byte> cachedHash = File.ReadAllBytes(cacheItemSpec); if (currentHashSpan.SequenceEqual(cachedHash)) { SharpGenLogger.Message("Properties hash matches cached value."); writeNeeded = false; } else { SharpGenLogger.Message("Properties hash mismatch, writing a new property cache file."); writeNeeded = true; } } else { SharpGenLogger.Message("Properties cache doesn't exist."); writeNeeded = true; } if (writeNeeded) { File.WriteAllBytes(cacheItemSpec, currentHash); } return(true); }
private ConfigFile LoadConfig(ConfigFile config) { config = ConfigFile.Load(config, Macros, SharpGenLogger); var sdkResolver = new SdkResolver(SharpGenLogger); SharpGenLogger.Message("Resolving SDKs..."); foreach (var cfg in config.ConfigFilesLoaded) { SharpGenLogger.Message("Resolving SDK for Config {0}", cfg); foreach (var sdk in cfg.Sdks) { SharpGenLogger.Message("Resolving {0}: Version {1}", sdk.Name, sdk.Version); foreach (var directory in sdkResolver.ResolveIncludeDirsForSdk(sdk)) { SharpGenLogger.Message("Resolved include directory {0}", directory); cfg.IncludeDirs.Add(directory); } } } return(config); }