void ParseCmdLineProperties() { InitBaselineTargetFx(); if (string.IsNullOrWhiteSpace(ProjectType) && ProjType == SdkProjectType.UnDetermined) { ProjType = SdkProjectType.Sdk; } else { ProjType = ParseProjectKind <SdkProjectType>(ProjectType, SdkProjectType.Sdk); } if (string.IsNullOrWhiteSpace(ProjectCategory) && ProjCat == SdkProjectCategory.UnDetermined) { ProjCat = SdkProjectCategory.MgmtPlane; } else { ProjCat = ParseProjectKind <SdkProjectCategory>(ProjectCategory, SdkProjectCategory.MgmtPlane); } if (!string.IsNullOrWhiteSpace(BuildScope)) { MultipleScopes.Add(BuildScope); } if (!string.IsNullOrWhiteSpace(BuildScopes)) { if (BuildScopes.Contains(";")) { var tokens = BuildScopes.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); if (tokens.Any <string>()) { MultipleScopes = tokens.ToList <string>(); } } else { MultipleScopes.Add(BuildScopes); } } if (!string.IsNullOrWhiteSpace(FullyQualifiedBuildScopeDirPath)) { MultipleScopes.Add(FullyQualifiedBuildScopeDirPath); } }
List <string> GetProjectsToBeSkiped() { string notSupportedErrorFormat = @"Unable to execute skipping tests on following directory '{0}'"; List <string> ScopedProjects = new List <string>(); // We will not skip broad build scope (e.g. sdk), the idea is to not to skip all the tests in a broader build scope. if (BuildScope.Equals("sdk", StringComparison.OrdinalIgnoreCase)) { TaskLogger.LogException <NotSupportedException>(notSupportedErrorFormat, BuildScope); } else if (BuildScopes.Equals("sdk", StringComparison.OrdinalIgnoreCase)) { TaskLogger.LogException <NotSupportedException>(notSupportedErrorFormat, BuildScope); } else { string sdkRootDirPath = Path.Combine(RepositoryRootDirPath, "sdk"); CategorizeSDKProjectsTask catProj = new CategorizeSDKProjectsTask(RepositoryRootDirPath, BuildScope, null, ProjectType, ProjectCategory); catProj.BuildScopes = BuildScopes; catProj.Execute(); if (catProj.MultipleScopes.Contains("sdk")) { TaskLogger.LogException <NotSupportedException>(notSupportedErrorFormat, sdkRootDirPath); } else { var sdkProj = catProj.SDK_Projects.Select <SDKMSBTaskItem, string>((item) => item.ItemSpec); var testProj = catProj.Test_Projects.Select <SDKMSBTaskItem, string>((item) => item.ItemSpec); if (sdkProj.NotNullOrAny <string>()) { ScopedProjects.AddRange(sdkProj.ToList <string>()); } if (testProj.NotNullOrAny <string>()) { ScopedProjects.AddRange(testProj.ToList <string>()); } } } return(ScopedProjects); }