-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c4bbb6
commit b1cd547
Showing
105 changed files
with
1,748 additions
and
1,535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/Abstractions/IDeferredMacro.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using Microsoft.TemplateEngine.Abstractions; | ||
|
||
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Abstractions | ||
{ | ||
/// <summary> | ||
/// interface for macros created via generated symbols. | ||
/// An interface for macros created that can create the config from other config (deffered config). | ||
/// </summary> | ||
[Obsolete("Use IGeneratedSymbolConfig{T} instead.")] | ||
public interface IDeferredMacro : IMacro | ||
{ | ||
/// <summary> | ||
/// Creates <see cref="IMacroConfig"/> from <paramref name="rawConfig"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// Deprecated as <see cref="IMacro"/> can process only own configuration. Use generic version of interface and <see cref="IGeneratedSymbolMacro{T}.CreateConfig(IEngineEnvironmentSettings, IGeneratedSymbolConfig)"/> instead. | ||
/// </remarks> | ||
[Obsolete("Use IGeneratedSymbolConfig{T}.Evaluate or IGeneratedSymbolConfig{T}.CreateConfig instead")] | ||
IMacroConfig CreateConfig(IEngineEnvironmentSettings environmentSettings, IMacroConfig rawConfig); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...osoft.TemplateEngine.Orchestrator.RunnableProjects/Abstractions/IGeneratedSymbolConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Abstractions | ||
{ | ||
/// <summary> | ||
/// Represents the configuration of <see cref="IGeneratedSymbolMacro"/> and <see cref="IGeneratedSymbolMacro{T}"/>. | ||
/// </summary> | ||
public interface IGeneratedSymbolConfig : IMacroConfig | ||
{ | ||
/// <summary> | ||
/// Gets data type of the variable to be created. | ||
/// </summary> | ||
string DataType { get; } | ||
|
||
/// <summary> | ||
/// Gets the collection of additional macro parameters, where key is a parameter name, and value is a JSON value serialized to string. | ||
/// </summary> | ||
IReadOnlyDictionary<string, string> Parameters { get; } | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...rosoft.TemplateEngine.Orchestrator.RunnableProjects/Abstractions/IGeneratedSymbolMacro.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Microsoft.TemplateEngine.Abstractions; | ||
using Microsoft.TemplateEngine.Core.Contracts; | ||
|
||
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Abstractions | ||
{ | ||
/// <summary> | ||
/// An interface for macro created via generated symbols. | ||
/// </summary> | ||
public interface IGeneratedSymbolMacro : IMacro | ||
{ | ||
/// <summary> | ||
/// Evaluates macro defined via generated symbol (<see cref="IGeneratedSymbolConfig"/>). | ||
/// The result of macro evaluation is modification of variable collection <paramref name="variables"/>. | ||
/// </summary> | ||
void Evaluate(IEngineEnvironmentSettings environmentSettings, IVariableCollection variables, IGeneratedSymbolConfig generatedSymbolConfig); | ||
} | ||
|
||
/// <summary> | ||
/// An interface for macro created via generated symbols, that can create config from generated symbol config (<see cref="IGeneratedSymbolConfig"/>). | ||
/// </summary> | ||
/// <typeparam name="T">The type of macro config.</typeparam> | ||
public interface IGeneratedSymbolMacro<T> : IGeneratedSymbolMacro, IMacro<T> | ||
where T : IMacroConfig | ||
{ | ||
/// <summary> | ||
/// Creates macro config from <see cref="IGeneratedSymbolConfig"/>. | ||
/// </summary> | ||
T CreateConfig(IEngineEnvironmentSettings environmentSettings, IGeneratedSymbolConfig generatedSymbolConfig); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/Abstractions/IMacro.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using Microsoft.TemplateEngine.Abstractions; | ||
using Microsoft.TemplateEngine.Core.Contracts; | ||
|
||
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Abstractions | ||
{ | ||
/// <summary> | ||
/// Represents a macro that can modify variable collection before template instantiation. | ||
/// </summary> | ||
public interface IMacro : IIdentifiedComponent | ||
{ | ||
/// <summary> | ||
/// Gets macro type. The type identifies the macro and should be unique. | ||
/// </summary> | ||
string Type { get; } | ||
|
||
/// <summary> | ||
/// Evaluates the macro based on <paramref name="config"/>. The result is modification of variable collection <paramref name="vars"/>. | ||
/// </summary> | ||
[Obsolete("Use IMacro<T>.Evaluate instead")] | ||
void EvaluateConfig(IEngineEnvironmentSettings environmentSettings, IVariableCollection vars, IMacroConfig config); | ||
} | ||
|
||
/// <summary> | ||
/// Represents a macro that can modify variable collection before template instantiation. | ||
/// </summary> | ||
public interface IMacro<T> : IMacro where T : IMacroConfig | ||
{ | ||
/// <summary> | ||
/// Evaluates the macro based on <paramref name="config"/>. The result is modification of variable collection <paramref name="variables"/>. | ||
/// </summary> | ||
void Evaluate(IEngineEnvironmentSettings environmentSettings, IVariableCollection variables, T config); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.