Skip to content

Commit

Permalink
Add base tasks to Default configs in make-option.js
Browse files Browse the repository at this point in the history
  • Loading branch information
qianz2 committed Oct 8, 2023
1 parent da6bb21 commit 63e6d73
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 7 deletions.
4 changes: 2 additions & 2 deletions BuildConfigGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static void Main3(string task, string configsString, bool writeUpdates,
string[] configs = configsString.Split("|");
string errorMessage;

Dictionary<string, Config.ConfigRecord> configdefs = new(Config.Configs.Where(x => !x.isDefault).Select(x => new KeyValuePair<string, Config.ConfigRecord>(x.name, x)));
Dictionary<string, Config.ConfigRecord> configdefs = new(Config.Configs.Select(x => new KeyValuePair<string, Config.ConfigRecord>(x.name, x)));
HashSet<Config.ConfigRecord> targetConfigs = new HashSet<Config.ConfigRecord>();
targetConfigs.Add(Config.Default);
foreach (var config in configs)
Expand All @@ -88,7 +88,7 @@ private static void Main3(string task, string configsString, bool writeUpdates,
}
else
{
errorMessage = "Configs specified must be one of: " + string.Join(',', Config.Configs.Where(x => !x.isDefault).Select(x => x.name));
errorMessage = "Configs specified must be one of: " + string.Join(',', Config.Configs.Select(x => x.name));
throw new Exception(errorMessage);
}
}
Expand Down
151 changes: 151 additions & 0 deletions make-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,157 @@
"task.loc.json",
"Tests"
],
"Default": [
"AppCenterDistributeV1",
"AppCenterDistributeV2",
"AppCenterDistributeV3",
"AppCenterTestV1",
"AzureAppServiceManageV0",
"AzureAppServiceSettingsV1",
"AzureCLIV1",
"AzureCLIV2",
"AzureCloudPowerShellDeploymentV1",
"AzureCloudPowerShellDeploymentV2",
"AzureContainerAppsV0",
"AzureContainerAppsV1",
"AzureFileCopyV1",
"AzureFileCopyV4",
"AzureFileCopyV5",
"AzureFunctionAppContainerV1",
"AzureFunctionOnKubernetesV0",
"AzureFunctionOnKubernetesV1",
"AzureFunctionV1",
"AzureIoTEdgeV2",
"AzureKeyVaultV1",
"AzureKeyVaultV2",
"AzureMonitorV0",
"AzureMonitorV1",
"AzureMysqlDeploymentV1",
"AzureNLBManagementV1",
"AzurePolicyV0",
"AzurePowerShellV2",
"AzurePowerShellV3",
"AzurePowerShellV4",
"AzurePowerShellV5",
"AzureResourceGroupDeploymentV2",
"AzureRmWebAppDeploymentV4",
"AzureStaticWebAppV0",
"AzureWebAppV1",
"BatchScriptV1",
"CacheBetaV0",
"CacheBetaV1",
"CacheV2",
"CargoAuthenticateV0",
"ChefKnifeV1",
"ChefV1",
"CondaAuthenticateV0",
"CondaEnvironmentV0",
"CondaEnvironmentV1",
"ContainerBuildV0",
"ContainerStructureTestV0",
"DelayV1",
"DeployVisualStudioTestAgentV2",
"DockerInstallerV0",
"DockerV0",
"DockerV1",
"DockerV2",
"DotNetCoreCLIV2",
"DotNetCoreInstallerV0",
"DotNetCoreInstallerV1",
"DownloadBuildArtifactsV0",
"DownloadBuildArtifactsV1",
"DownloadFileshareArtifactsV1",
"DownloadGitHubNpmPackageV1",
"DownloadGitHubNugetPackageV1",
"DownloadGitHubReleaseV0",
"DownloadPackageV0",
"DownloadPackageV1",
"DownloadPipelineArtifactV0",
"DownloadPipelineArtifactV1",
"DownloadPipelineArtifactV2",
"DuffleInstallerV0",
"FileTransformV1",
"FileTransformV2",
"FuncToolsInstallerV0",
"GitHubCommentV0",
"GitHubReleaseV0",
"GitHubReleaseV1",
"GoToolV0",
"GoV0",
"GradleV2",
"GradleV3",
"HelmDeployV0",
"HelmInstallerV0",
"HelmInstallerV1",
"IISWebAppDeployment",
"IISWebAppManagementOnMachineGroupV0",
"InvokeRestApiV1",
"JenkinsDownloadArtifactsV1",
"KubectlInstallerV0",
"KubeloginInstallerV0",
"KubernetesManifestV0",
"KubernetesManifestV1",
"KubernetesV0",
"KubernetesV1",
"ManualInterventionV8",
"ManualValidationV0",
"MavenAuthenticateV0",
"MavenV2",
"MavenV4",
"MysqlDeploymentOnMachineGroupV1",
"NpmAuthenticateV0",
"NpmV0",
"NpmV1",
"NuGetAuthenticateV1",
"NuGetCommandV2",
"NuGetInstallerV0",
"NuGetPackagerV0",
"NuGetPublisherV0",
"NuGetRestoreV1",
"NuGetToolInstallerV0",
"NuGetToolInstallerV1",
"NuGetV0",
"OpenPolicyAgentInstallerV0",
"PackerBuildV0",
"PackerBuildV1",
"PipAuthenticateV0",
"PipAuthenticateV1",
"PowerShellOnTargetMachinesV3",
"PublishCodeCoverageResultsV1",
"PublishCodeCoverageResultsV2",
"PublishPipelineArtifactV0",
"PublishPipelineArtifactV1",
"PublishPipelineMetadataV0",
"PublishTestResultsV1",
"PublishTestResultsV2",
"PublishToAzureServiceBusV1",
"QueryWorkItemsV0",
"QuickPerfTestV1",
"ReviewAppV0",
"RunJMeterLoadTestV1",
"RunLoadTestV1",
"ServiceFabricComposeDeployV0",
"ServiceFabricDeployV1",
"ServiceFabricPowerShellV1",
"ServiceFabricUpdateManifestsV2",
"SqlAzureDacpacDeploymentV1",
"SqlDacpacDeploymentOnMachineGroupV0",
"SqlServerDacpacDeployment",
"TwineAuthenticateV0",
"TwineAuthenticateV1",
"UniversalPackagesV0",
"UsePythonVersionV0",
"UseRubyVersionV0",
"VSBuildV1",
"VsTestPlatformToolInstallerV1",
"VsTestV1",
"VsTestV2",
"VsTestV3",
"WindowsMachineFileCopyV1",
"WindowsMachineFileCopyV2",
"XamarinAndroidV1",
"XamariniOSV2"
],
"Node16_225": [
"UseDotNetV2",
"AzureVmssDeploymentV0",
Expand Down
7 changes: 2 additions & 5 deletions make.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ function getNodeVersion (taskName) {
}

function buildTask(taskName, taskListLength, nodeVersion) {
let isGeneratedTask = false;
banner(`Building task ${taskName} using Node.js ${nodeVersion}`);
const removeNodeModules = taskListLength > 1;

Expand All @@ -275,13 +274,11 @@ function buildTask(taskName, taskListLength, nodeVersion) {
if (fs.existsSync(taskPath)) {
// Need to add all tasks which starts with task name
console.log('Found generated task: ' + taskName);
isGeneratedTask = true;
} else {
// taskPath = path.join(tasksPath, taskName);
isGeneratedBaseTaskOnTheFly = true;
let generateDefault = true;
console.log('Did not find generated task: ' + taskName + ', generating task on the fly...');
util.processGeneratedTasks(baseConfigToolPath, [taskName], fileToJson(makeOptionsPath), writeUpdatedsFromGenTasks, generateDefault);
util.processGeneratedTasks(baseConfigToolPath, [taskName], fileToJson(makeOptionsPath), writeUpdatedsFromGenTasks, true);
}

ensureExists(taskPath);
Expand Down Expand Up @@ -340,7 +337,7 @@ function buildTask(taskName, taskListLength, nodeVersion) {
banner('Building module ' + modPath, true);

// Ensure that Common folder exists for _generated tasks, otherwise copy it from Tasks folder
if (!fs.existsSync(genTaskCommonPath) && isGeneratedTask) {
if (!fs.existsSync(genTaskCommonPath)) {
cp('-Rf', path.resolve(tasksPath, "Common"), genTaskCommonPath);
}

Expand Down

0 comments on commit 63e6d73

Please sign in to comment.