public async IAsyncEnumerable <SdkInfo> ListAvailableSdks() { foreach (var subDir in Directory.GetDirectories(Path.Combine(extractedDir, "sdks"))) { yield return(await SdkLoader.LoadSdk(Path.Combine(subDir, "sdk.json"))); } }
public async Task <(string hash, string installDir)> GetInstalledSdkDir(SdkInfo sdk) { var sdkHash = SdkLoader.SdkSha256(sdk); var sdkDir = Path.Combine(replayRecorder.extractedDir, ArchiveRecorder.SdkPath(sdkHash)); if (!Directory.Exists(sdkDir)) { throw new Exception("Unknown SDK."); } return(sdkHash, Path.Combine(sdkDir, "install")); }
private static async Task Main(string[] args) { string sdkDir = Path.Combine(Environment.CurrentDirectory, "sdks"); ClearDirectory(sdkDir); foreach (var creator in sdkCreators) { await foreach (var(path, sdk) in creator.GenerateSdks()) { string fullPath = Path.Combine(sdkDir, path); EnsureDirectory(Path.GetDirectoryName(fullPath)); await SdkLoader.SaveSdk(fullPath, sdk); } } }
public IAsyncEnumerable <SdkInfo> ListAvailableSdks() => SdkLoader.LoadSdks(SdkDir);
public static async Task Main(string[] args) { var resolver = await SdkResolver.Build(SdkLoader.LoadSdks("sdks/")); await CreateHostBuilder(resolver).Build().RunAsync(); }