Exemplo n.º 1
0
 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")));
     }
 }
Exemplo n.º 2
0
            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"));
            }
Exemplo n.º 3
0
        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);
                }
            }
        }
Exemplo n.º 4
0
 public IAsyncEnumerable <SdkInfo> ListAvailableSdks() => SdkLoader.LoadSdks(SdkDir);
Exemplo n.º 5
0
        public static async Task Main(string[] args)
        {
            var resolver = await SdkResolver.Build(SdkLoader.LoadSdks("sdks/"));

            await CreateHostBuilder(resolver).Build().RunAsync();
        }