|
1 |
| -// |
| 1 | +// |
2 | 2 | // Copyright (c) Microsoft. All rights reserved.
|
3 | 3 | //
|
4 | 4 | // Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -362,25 +362,28 @@ private bool ProcessFileChanged(Dictionary<string, string[]> csprojMap)
|
362 | 362 |
|
363 | 363 | Dictionary<string, HashSet<string>> influencedModuleInfo = CalculateInfluencedModuleInfoForEachPhase(ruleList, csprojMap);
|
364 | 364 | DateTime endOfRegularExpressionTime = DateTime.Now;
|
365 |
| - |
366 |
| - influencedModuleInfo = CalculateCsprojForBuildAndTest(influencedModuleInfo, csprojMap); |
367 |
| - DateTime endTime = DateTime.Now; |
368 |
| - Console.WriteLine(string.Format("Takes {0} seconds for RE match, {1} seconds for phase config.", (endOfRegularExpressionTime - startTime).TotalSeconds, (endTime - endOfRegularExpressionTime).TotalSeconds)); |
369 |
| - |
370 |
| - if (!Directory.Exists(config.ArtifactPipelineInfoFolder)) |
371 |
| - { |
372 |
| - Directory.CreateDirectory(config.ArtifactPipelineInfoFolder); |
373 |
| - } |
| 365 | + |
| 366 | + #region Record the CI plan info to CIPlan.json under the artifacts folder |
374 | 367 | Dictionary<string, HashSet<string>> CIPlan = new Dictionary<string, HashSet<string>>
|
375 | 368 | {
|
376 |
| - [BUILD_PHASE] = new HashSet<string>(influencedModuleInfo[BUILD_PHASE].Select(GetModuleNameFromPath).Where(x => x != null)), |
377 |
| - [TEST_PHASE] = new HashSet<string>(influencedModuleInfo[TEST_PHASE].Select(GetModuleNameFromPath).Where(x => x != null)) |
| 369 | + [BUILD_PHASE] = new HashSet<string>(influencedModuleInfo[BUILD_PHASE]), |
| 370 | + [TEST_PHASE] = new HashSet<string>(influencedModuleInfo[TEST_PHASE]) |
378 | 371 | };
|
379 | 372 | foreach (var analysisPhase in ANALYSIS_PHASE_LIST)
|
380 | 373 | {
|
381 | 374 | CIPlan.Add(analysisPhase, influencedModuleInfo[analysisPhase]);
|
382 | 375 | }
|
| 376 | + if (!Directory.Exists(config.ArtifactPipelineInfoFolder)) |
| 377 | + { |
| 378 | + Directory.CreateDirectory(config.ArtifactPipelineInfoFolder); |
| 379 | + } |
383 | 380 | File.WriteAllText(Path.Combine(config.ArtifactPipelineInfoFolder, "CIPlan.json"), JsonConvert.SerializeObject(CIPlan, Formatting.Indented));
|
| 381 | + #endregion |
| 382 | + |
| 383 | + influencedModuleInfo = CalculateCsprojForBuildAndTest(influencedModuleInfo, csprojMap); |
| 384 | + DateTime endTime = DateTime.Now; |
| 385 | + Console.WriteLine(string.Format("Takes {0} seconds for RE match, {1} seconds for phase config.", (endOfRegularExpressionTime - startTime).TotalSeconds, (endTime - endOfRegularExpressionTime).TotalSeconds)); |
| 386 | + |
384 | 387 | influencedModuleInfo[TEST_PHASE] = new HashSet<string>(influencedModuleInfo[TEST_PHASE].Where(x => x.EndsWith(".csproj")));
|
385 | 388 |
|
386 | 389 | BuildCsprojList = influencedModuleInfo[BUILD_PHASE].ToArray();
|
|
0 commit comments