Skip to content

Commit

Permalink
small fixes after self review
Browse files Browse the repository at this point in the history
  • Loading branch information
vlada-shubina committed Oct 7, 2022
1 parent 6fd6eda commit 716f958
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects
{
internal static class MacroProcessor
{
// Warning: if there are unknown macro "types", they are quietly ignored here.
// This applies to both the regular and deferred macros.

/// <summary>
/// Processes the macros defined in <paramref name="runConfig"/>.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ private IReadOnlyList<IReplacementTokens> ProduceSymbolFilenameReplacements()
}
else
{
_settings.Host.Logger.LogDebug($"Unable to find a form called '{formName}'");
_settings.Host.Logger.LogWarning(LocalizableStrings.RunnableProjectConfig_OperationSetup_UnknownForm, p.Name, formName);
}
}
}
Expand Down Expand Up @@ -470,7 +470,7 @@ private GlobalRunConfig ProduceOperationSetup(OperationConfigDefault defaultMode
if (generateMacros)
{
generatedSymbolMacros = ProduceGeneratedSymbolsMacroConfig();
computedMacros = ProduceMacroConfig();
computedMacros = ProduceComputedMacroConfig();
}

foreach (BaseSymbol symbol in ConfigurationModel.Symbols)
Expand Down Expand Up @@ -602,7 +602,7 @@ private List<IGeneratedSymbolConfig> ProduceGeneratedSymbolsMacroConfig()
return ConfigurationModel.Symbols.OfType<IGeneratedSymbolConfig>().ToList();
}

private List<BaseMacroConfig> ProduceMacroConfig()
private List<BaseMacroConfig> ProduceComputedMacroConfig()
{
List<BaseMacroConfig> computedMacroConfigs = new();
foreach (ComputedSymbol symbol in ConfigurationModel.Symbols.OfType<ComputedSymbol>())
Expand All @@ -626,19 +626,6 @@ private List<BaseMacroConfig> ProduceMacroConfig()
return computedMacroConfigs;
}

private List<IMacroConfig> ProduceComputedMacroConfig()
{
List<IMacroConfig> computedMacroConfigs = new List<IMacroConfig>();
foreach (ComputedSymbol symbol in ConfigurationModel.Symbols.OfType<ComputedSymbol>())
{
string value = symbol.Value;
string? evaluator = symbol.Evaluator;
computedMacroConfigs.Add(new EvaluateMacroConfig(symbol.Name, "bool", value, evaluator));
}

return computedMacroConfigs;
}

private List<FileSourceMatchInfo> EvaluateSources(IVariableCollection rootVariableCollection, object? resolvedNameParamValue)
{
List<FileSourceMatchInfo> sources = new();
Expand Down

0 comments on commit 716f958

Please sign in to comment.