internal FileSignInfo(FileName name, SignInfo fileSignData) { Debug.Assert(name.IsAssembly || fileSignData.StrongName == null); FileName = name; FileSignData = fileSignData; }
internal static BatchSignInput ReadBatchSignInput(string rootBinaryPath) { var filePath = Path.Combine(AppContext.BaseDirectory, "BatchSignData.json"); using (var file = File.OpenText(filePath)) { var serializer = new JsonSerializer(); var fileJson = (Json.FileJson)serializer.Deserialize(file, typeof(Json.FileJson)); var map = new Dictionary<string, SignInfo>(); var allGood = true; foreach (var item in fileJson.SignList) { var data = new SignInfo(certificate: item.Certificate, strongName: item.StrongName); foreach (var name in item.FileList) { if (map.ContainsKey(name)) { Console.WriteLine($"Duplicate file entry: {name}"); allGood = false; } else { map.Add(name, data); } } } if (!allGood) { Environment.Exit(1); } return new BatchSignInput(rootBinaryPath, map, fileJson.ExcludeList); } }
internal static BatchSignInput ReadBatchSignInput(string rootBinaryPath) { var filePath = Path.Combine(AppContext.BaseDirectory, "BatchSignData.json"); using (var file = File.OpenText(filePath)) { var serializer = new JsonSerializer(); var fileJson = (Json.FileJson)serializer.Deserialize(file, typeof(Json.FileJson)); var map = new Dictionary <string, SignInfo>(); var allGood = true; foreach (var item in fileJson.SignList) { var data = new SignInfo(certificate: item.Certificate, strongName: item.StrongName); foreach (var name in item.FileList) { if (map.ContainsKey(name)) { Console.WriteLine($"Duplicate file entry: {name}"); allGood = false; } else { map.Add(name, data); } } } if (!allGood) { Environment.Exit(1); } return(new BatchSignInput(rootBinaryPath, map, fileJson.ExcludeList)); } }