Skip to content

Commit 2276f04

Browse files
authored
chore: Rename namespaces, libraries and tool (#19)
1 parent 410da0e commit 2276f04

File tree

131 files changed

+146
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+146
-146
lines changed

apim-policy-toolkit.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Analyzers", "src\Analyzers\
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authoring", "src\Authoring\Authoring.csproj", "{73E9FE2D-21B6-47A0-B481-0A2F9B4BEECB}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compiler", "src\Compiler\Compiler.csproj", "{19972331-73C3-4E55-88AA-F2F267518BFD}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compiling", "src\Compiling\Compiling.csproj", "{19972331-73C3-4E55-88AA-F2F267518BFD}"
1313
EndProject
1414
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "src\Core\Core.csproj", "{64B92AAB-891B-47CC-B49A-EE9B82D60FEF}"
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emulator", "src\Emulator\Emulator.csproj", "{AC6B5B9C-6B35-45A0-A8C5-6E51EAB8A070}"
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing", "src\Testing\Testing.csproj", "{AC6B5B9C-6B35-45A0-A8C5-6E51EAB8A070}"
1717
EndProject
1818
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A304AE9C-D781-4AC1-9778-0297ADF6037F}"
1919
EndProject
2020
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Analyzers", "test\Test.Analyzers\Test.Analyzers.csproj", "{D9C442AF-4468-449F-B9E7-36DB7133129B}"
2121
EndProject
2222
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Core", "test\Test.Core\Test.Core.csproj", "{1FC87E86-14AF-4240-BE52-8AB3BA09D47A}"
2323
EndProject
24-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Emulator", "test\Test.Emulator\Test.Emulator.csproj", "{43D3022B-F065-4B50-8C3A-AC6B58D9649C}"
24+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Testing", "test\Test.Testing\Test.Testing.csproj", "{43D3022B-F065-4B50-8C3A-AC6B58D9649C}"
2525
EndProject
2626
Global
2727
GlobalSection(SolutionConfigurationPlatforms) = preSolution

docs/QuickStart.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ solution folder.
104104
105105
```shell
106106
cd .. # Go to solution folder if not already there
107-
dotnet tool install Azure.ApiManagement.PolicyToolkit.Compiler
107+
dotnet tool install Azure.ApiManagement.PolicyToolkit.Compiling
108108
````
109109
110110
After the installation, the compiler should be available in the project folder.
111111
Now lets run the compiler to generate policy document. Execute compiler command in the solution folder.
112112
113113
```shell
114-
dotnet policy-compiler --s .\Contoso.Apis.Policies --o . --format true
114+
dotnet azure-apim-policy-compiler --s .\Contoso.Apis.Policies --o . --format true
115115
```
116116
117-
The compiler is a dotnet tool named `policy-compiler`. The `--s` parameter is a source folder with policy documents.
117+
The compiler is a dotnet tool named `azure-apim-policy-compiler`. The `--s` parameter is a source folder with policy documents.
118118
The `--o` parameter is an output folder for generated policy documents. The `--format` parameter is a flag which tells
119119
the compiler to format the generated document.
120120
@@ -219,7 +219,7 @@ context.SomePolicy(new Config()
219219
Cool! We have a more complex policy document. Now let's compile it to a policy document.
220220
221221
```shell
222-
dotnet policy-compiler --s .\source --o . --format true
222+
dotnet azure-apim-policy-compiler --s .\source --o . --format true
223223
```
224224
225225
Content of the generated file should be:
@@ -254,7 +254,7 @@ the following commands.
254254
```shell
255255
dotnet new mstest --output Contoso.Apis.Policies.Tests
256256
cd Contoso.Apis.Policies.Tests
257-
dotnet add package Azure.ApiManagement.PolicyToolkit.Emulator
257+
dotnet add package Azure.ApiManagement.PolicyToolkit.Testing
258258
dotnet add reference ..\Contoso.Apis.Policies
259259
dotnet new class -n ApiOperationPolicyTest
260260
```
@@ -264,7 +264,7 @@ Perfect! Now we can write a test for `IsCompanyIP` method in the class.
264264
```csharp
265265
using Contoso.Apis.Policies;
266266
267-
using Azure.ApiManagement.PolicyToolkit.Emulator.Expressions;
267+
using Azure.ApiManagement.PolicyToolkit.Testing.Expressions;
268268
269269
using Microsoft.VisualStudio.TestTools.UnitTesting;
270270
using Newtonsoft.Json.Linq;
@@ -292,7 +292,7 @@ Let's unpack the code above:
292292
293293
* Test class is a standard MSTest class with one test method. You can use your favorite testing framework in place of MSTest. Policy framework is not dependent on any testing framework.
294294
* `MockExpressionContext` is a class which is used to mock request context. It is available in
295-
`Azure.ApiManagement.PolicyToolkit.Emulator.Expressions` namespace. It implements `IExpressionContext`
295+
`Azure.ApiManagement.PolicyToolkit.Testing.Expressions` namespace. It implements `IExpressionContext`
296296
interface and exposes helper properties to set up request context.
297297
* `context.MockRequest.IpAddress = "10.0.0.12"` is setting a IpAddress for request.
298298

example/test/ApiOperationPolicyTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Contoso.Apis;
22

3-
using Azure.ApiManagement.PolicyToolkit.Emulator.Expressions;
3+
using Azure.ApiManagement.PolicyToolkit.Testing.Expressions;
44

55
using Newtonsoft.Json.Linq;
66

example/test/Test.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Azure.ApiManagement.PolicyToolkit.Emulator" Version="0.0.1" />
25+
<PackageReference Include="Azure.ApiManagement.PolicyToolkit.Testing" Version="0.0.1" />
2626
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
2727
</ItemGroup>
2828

src/Authoring/Authoring.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageProjectUrl>https://github.com/Azure/azure-api-management-policy-toolkit</PackageProjectUrl>
1111
<RepositoryUrl>https://github.com/Azure/azure-api-management-policy-toolkit</RepositoryUrl>
1212
<Description>
13-
Azure API Management Policy Toolkit is a library allowing creation of policy documents in code.
13+
Azure API Management Policy Toolkit Authoring is a library allowing creation of policy documents in code.
1414
Read more about it at https://github.com/Azure/azure-api-management-policy-toolkit
1515
</Description>
1616
<PackageTags>Azure;Azure API Management;API Gateway;API Management;Policy;Policies;Policy Toolkit;Authoring policies</PackageTags>

src/Compiler/CompilerOptions.cs renamed to src/Compiling/CompilerOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
using Microsoft.Extensions.Configuration;
77

8-
namespace Compiler;
8+
namespace Azure.ApiManagement.PolicyToolkit.Compiling;
99

1010
public class CompilerOptions
1111
{

src/Compiler/Compiler.csproj renamed to src/Compiling/Compiling.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<PackageId>Azure.ApiManagement.PolicyToolkit.Compiler</PackageId>
4+
<PackageId>Azure.ApiManagement.PolicyToolkit.Compiling</PackageId>
55
<PackageVersion>0.0.1</PackageVersion>
66
<Authors>Microsoft</Authors>
77
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -10,10 +10,10 @@
1010
<PackageProjectUrl>https://github.com/Azure/azure-api-management-policy-toolkit</PackageProjectUrl>
1111
<RepositoryUrl>https://github.com/Azure/azure-api-management-policy-toolkit</RepositoryUrl>
1212
<Description>
13-
Azure API Management Policy Toolkit compiler is a dotnet tool allowing you to transform policy document(s) from C# code to XML.
13+
Azure API Management Policy Toolkit Compiling is a dotnet tool allowing you to transform policy document(s) from C# code to XML.
1414
Read more about it at https://github.com/Azure/azure-api-management-policy-toolkit
1515
</Description>
16-
<PackageTags>Azure;Azure API Management;API Gateway;API Management;Policy;Policies;Policy Toolkit;Compiler;Policy Toolkit Compiler</PackageTags>
16+
<PackageTags>Azure;Azure API Management;API Gateway;API Management;Policy;Policies;Policy Toolkit;Compiling;Policy Toolkit Compiling</PackageTags>
1717
</PropertyGroup>
1818

1919
<PropertyGroup>
@@ -24,7 +24,7 @@
2424

2525
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
2626
<PackAsTool>true</PackAsTool>
27-
<ToolCommandName>policy-compiler</ToolCommandName>
27+
<ToolCommandName>azure-apim-policy-compiler</ToolCommandName>
2828
<PackageOutputPath>..\..\output</PackageOutputPath>
2929
</PropertyGroup>
3030

src/Compiler/Program.cs renamed to src/Compiling/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
using System.Text;
55
using System.Text.RegularExpressions;
66

7-
using Azure.ApiManagement.PolicyToolkit.Compilation;
7+
using Azure.ApiManagement.PolicyToolkit.Compiling;
8+
using Azure.ApiManagement.PolicyToolkit.Compiling;
89
using Azure.ApiManagement.PolicyToolkit.Serialization;
910

10-
using Compiler;
11-
1211
using Microsoft.CodeAnalysis.CSharp;
1312
using Microsoft.CodeAnalysis.CSharp.Syntax;
1413
using Microsoft.Extensions.Configuration;

src/Core/Compilation/CSharpPolicyCompiler.cs renamed to src/Core/Compiling/CSharpPolicyCompiler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
using System.Xml.Linq;
55

66
using Azure.ApiManagement.PolicyToolkit.Authoring;
7-
using Azure.ApiManagement.PolicyToolkit.Compilation.Policy;
8-
using Azure.ApiManagement.PolicyToolkit.Compilation.Syntax;
7+
using Azure.ApiManagement.PolicyToolkit.Compiling.Policy;
8+
using Azure.ApiManagement.PolicyToolkit.Compiling.Syntax;
99

1010
using Microsoft.CodeAnalysis.CSharp.Syntax;
1111

12-
namespace Azure.ApiManagement.PolicyToolkit.Compilation;
12+
namespace Azure.ApiManagement.PolicyToolkit.Compiling;
1313

1414
public class CSharpPolicyCompiler
1515
{

src/Core/Compilation/CompilationContext.cs renamed to src/Core/Compiling/CompilationContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
using Microsoft.CodeAnalysis;
77

8-
namespace Azure.ApiManagement.PolicyToolkit.Compilation;
8+
namespace Azure.ApiManagement.PolicyToolkit.Compiling;
99

1010
public class CompilationContext : ICompilationContext, ICompilationResult
1111
{

0 commit comments

Comments
 (0)