Skip to content

Commit 643211b

Browse files
authored
refactor: Remove pack projects (#16)
1 parent 051addb commit 643211b

File tree

11 files changed

+188
-250
lines changed

11 files changed

+188
-250
lines changed

apim-policy-toolkit.sln

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "src\Core\Core.cspro
1515
EndProject
1616
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emulator", "src\Emulator\Emulator.csproj", "{AC6B5B9C-6B35-45A0-A8C5-6E51EAB8A070}"
1717
EndProject
18-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pack", "Pack", "{AC023C27-C648-4C4F-BF79-DAC872FB4E08}"
19-
EndProject
20-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Policy", "src\Pack\Policy\Policy.csproj", "{1D1A4465-7829-4FCB-A99B-10C676FF6B79}"
21-
EndProject
22-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing", "src\Pack\Testing\Testing.csproj", "{63616BEB-6981-432B-B26C-867351C3B9A0}"
23-
EndProject
2418
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A304AE9C-D781-4AC1-9778-0297ADF6037F}"
2519
EndProject
2620
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Analyzers", "test\Test.Analyzers\Test.Analyzers.csproj", "{D9C442AF-4468-449F-B9E7-36DB7133129B}"
@@ -58,14 +52,6 @@ Global
5852
{AC6B5B9C-6B35-45A0-A8C5-6E51EAB8A070}.Debug|Any CPU.Build.0 = Debug|Any CPU
5953
{AC6B5B9C-6B35-45A0-A8C5-6E51EAB8A070}.Release|Any CPU.ActiveCfg = Release|Any CPU
6054
{AC6B5B9C-6B35-45A0-A8C5-6E51EAB8A070}.Release|Any CPU.Build.0 = Release|Any CPU
61-
{1D1A4465-7829-4FCB-A99B-10C676FF6B79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62-
{1D1A4465-7829-4FCB-A99B-10C676FF6B79}.Debug|Any CPU.Build.0 = Debug|Any CPU
63-
{1D1A4465-7829-4FCB-A99B-10C676FF6B79}.Release|Any CPU.ActiveCfg = Release|Any CPU
64-
{1D1A4465-7829-4FCB-A99B-10C676FF6B79}.Release|Any CPU.Build.0 = Release|Any CPU
65-
{63616BEB-6981-432B-B26C-867351C3B9A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
66-
{63616BEB-6981-432B-B26C-867351C3B9A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
67-
{63616BEB-6981-432B-B26C-867351C3B9A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
68-
{63616BEB-6981-432B-B26C-867351C3B9A0}.Release|Any CPU.Build.0 = Release|Any CPU
6955
{D9C442AF-4468-449F-B9E7-36DB7133129B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
7056
{D9C442AF-4468-449F-B9E7-36DB7133129B}.Debug|Any CPU.Build.0 = Debug|Any CPU
7157
{D9C442AF-4468-449F-B9E7-36DB7133129B}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -85,9 +71,6 @@ Global
8571
{19972331-73C3-4E55-88AA-F2F267518BFD} = {A301B8E9-1238-4D19-B0B5-0A8CC5CC6BA3}
8672
{64B92AAB-891B-47CC-B49A-EE9B82D60FEF} = {A301B8E9-1238-4D19-B0B5-0A8CC5CC6BA3}
8773
{AC6B5B9C-6B35-45A0-A8C5-6E51EAB8A070} = {A301B8E9-1238-4D19-B0B5-0A8CC5CC6BA3}
88-
{AC023C27-C648-4C4F-BF79-DAC872FB4E08} = {A301B8E9-1238-4D19-B0B5-0A8CC5CC6BA3}
89-
{1D1A4465-7829-4FCB-A99B-10C676FF6B79} = {AC023C27-C648-4C4F-BF79-DAC872FB4E08}
90-
{63616BEB-6981-432B-B26C-867351C3B9A0} = {AC023C27-C648-4C4F-BF79-DAC872FB4E08}
9174
{D9C442AF-4468-449F-B9E7-36DB7133129B} = {A304AE9C-D781-4AC1-9778-0297ADF6037F}
9275
{1FC87E86-14AF-4240-BE52-8AB3BA09D47A} = {A304AE9C-D781-4AC1-9778-0297ADF6037F}
9376
{43D3022B-F065-4B50-8C3A-AC6B58D9649C} = {A304AE9C-D781-4AC1-9778-0297ADF6037F}

docs/QuickStart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.Testing
257+
dotnet add package Azure.ApiManagement.PolicyToolkit.Emulator
258258
dotnet add reference ..\Contoso.Apis.Policies
259259
dotnet new class -n ApiOperationPolicyTest
260260
```

example/source/Source.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Azure.ApiManagement.PolicyToolkit" Version="0.0.1" />
14+
<PackageReference Include="Azure.ApiManagement.PolicyToolkit.Authoring" Version="0.0.1" />
1515
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1616
</ItemGroup>
1717
</Project>

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

src/Authoring/Authoring.csproj

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,51 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<PropertyGroup>
4+
<PackageId>Azure.ApiManagement.PolicyToolkit.Authoring</PackageId>
5+
<PackageVersion>0.0.1</PackageVersion>
6+
<Authors>Microsoft</Authors>
7+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
8+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
9+
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
10+
<PackageProjectUrl>https://github.com/Azure/azure-api-management-policy-toolkit</PackageProjectUrl>
11+
<RepositoryUrl>https://github.com/Azure/azure-api-management-policy-toolkit</RepositoryUrl>
12+
<Description>
13+
Azure API Management Policy Toolkit is a library allowing creation of policy documents in code.
14+
Read more about it at https://github.com/Azure/azure-api-management-policy-toolkit
15+
</Description>
16+
<PackageTags>Azure;Azure API Management;API Gateway;API Management;Policy;Policies;Policy Toolkit;Authoring policies</PackageTags>
17+
</PropertyGroup>
18+
319
<PropertyGroup>
420
<TargetFramework>.net8</TargetFramework>
521
<ImplicitUsings>enable</ImplicitUsings>
622
<Nullable>enable</Nullable>
7-
<IsPackable>false</IsPackable>
823
<GenerateDocumentationFile>true</GenerateDocumentationFile>
24+
<IsPackable>true</IsPackable>
25+
<PackageOutputPath>..\..\output</PackageOutputPath>
26+
<IncludeBuildOutput>true</IncludeBuildOutput>
27+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
28+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
29+
30+
<TargetsForTfmSpecificContentInPackage>
31+
$(TargetsForTfmSpecificContentInPackage);_AddAnalyzersToOutput
32+
</TargetsForTfmSpecificContentInPackage>
933
</PropertyGroup>
1034

1135
<PropertyGroup>
1236
<NoWarn>1591</NoWarn> <!-- Disable warning CS1591: Missing XML comment for publicly visible type or member, should be removed in the future -->
1337
</PropertyGroup>
1438

39+
<ItemGroup>
40+
<ProjectReference Include="..\Analyzers\Analyzers.csproj"/>
41+
</ItemGroup>
42+
43+
<Target Name="_AddAnalyzersToOutput">
44+
<ItemGroup>
45+
<TfmSpecificPackageFile Include="$(OutputPath)\Analyzers.dll"
46+
PackagePath="analyzers/dotnet/cs"/>
47+
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath=""/>
48+
</ItemGroup>
49+
</Target>
50+
1551
</Project>
Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
param($installPath, $toolsPath, $package, $project)
2-
3-
if($project.Object.SupportsPackageDependencyResolution)
4-
{
5-
if($project.Object.SupportsPackageDependencyResolution())
6-
{
7-
# Do not install analyzers via install.ps1, instead let the project system handle it.
8-
return
9-
}
10-
}
11-
12-
$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers") * -Resolve
13-
14-
foreach($analyzersPath in $analyzersPaths)
15-
{
16-
if (Test-Path $analyzersPath)
17-
{
18-
# Install the language agnostic analyzers.
19-
foreach ($analyzerFilePath in Get-ChildItem -Path "$analyzersPath\*.dll" -Exclude *.resources.dll)
20-
{
21-
if($project.Object.AnalyzerReferences)
22-
{
23-
$project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName)
24-
}
25-
}
26-
}
27-
}
28-
29-
# $project.Type gives the language name like (C# or VB.NET)
30-
$languageFolder = ""
31-
if($project.Type -eq "C#")
32-
{
33-
$languageFolder = "cs"
34-
}
35-
if($project.Type -eq "VB.NET")
36-
{
37-
$languageFolder = "vb"
38-
}
39-
if($languageFolder -eq "")
40-
{
41-
return
42-
}
43-
44-
foreach($analyzersPath in $analyzersPaths)
45-
{
46-
# Install language specific analyzers.
47-
$languageAnalyzersPath = join-path $analyzersPath $languageFolder
48-
if (Test-Path $languageAnalyzersPath)
49-
{
50-
foreach ($analyzerFilePath in Get-ChildItem -Path "$languageAnalyzersPath\*.dll" -Exclude *.resources.dll)
51-
{
52-
if($project.Object.AnalyzerReferences)
53-
{
54-
$project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName)
55-
}
56-
}
57-
}
1+
param($installPath, $toolsPath, $package, $project)
2+
3+
if($project.Object.SupportsPackageDependencyResolution)
4+
{
5+
if($project.Object.SupportsPackageDependencyResolution())
6+
{
7+
# Do not install analyzers via install.ps1, instead let the project system handle it.
8+
return
9+
}
10+
}
11+
12+
$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers") * -Resolve
13+
14+
foreach($analyzersPath in $analyzersPaths)
15+
{
16+
if (Test-Path $analyzersPath)
17+
{
18+
# Install the language agnostic analyzers.
19+
foreach ($analyzerFilePath in Get-ChildItem -Path "$analyzersPath\*.dll" -Exclude *.resources.dll)
20+
{
21+
if($project.Object.AnalyzerReferences)
22+
{
23+
$project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName)
24+
}
25+
}
26+
}
27+
}
28+
29+
# $project.Type gives the language name like (C# or VB.NET)
30+
$languageFolder = ""
31+
if($project.Type -eq "C#")
32+
{
33+
$languageFolder = "cs"
34+
}
35+
if($project.Type -eq "VB.NET")
36+
{
37+
$languageFolder = "vb"
38+
}
39+
if($languageFolder -eq "")
40+
{
41+
return
42+
}
43+
44+
foreach($analyzersPath in $analyzersPaths)
45+
{
46+
# Install language specific analyzers.
47+
$languageAnalyzersPath = join-path $analyzersPath $languageFolder
48+
if (Test-Path $languageAnalyzersPath)
49+
{
50+
foreach ($analyzerFilePath in Get-ChildItem -Path "$languageAnalyzersPath\*.dll" -Exclude *.resources.dll)
51+
{
52+
if($project.Object.AnalyzerReferences)
53+
{
54+
$project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName)
55+
}
56+
}
57+
}
5858
}
Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
param($installPath, $toolsPath, $package, $project)
2-
3-
if($project.Object.SupportsPackageDependencyResolution)
4-
{
5-
if($project.Object.SupportsPackageDependencyResolution())
6-
{
7-
# Do not uninstall analyzers via uninstall.ps1, instead let the project system handle it.
8-
return
9-
}
10-
}
11-
12-
$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers") * -Resolve
13-
14-
foreach($analyzersPath in $analyzersPaths)
15-
{
16-
# Uninstall the language agnostic analyzers.
17-
if (Test-Path $analyzersPath)
18-
{
19-
foreach ($analyzerFilePath in Get-ChildItem -Path "$analyzersPath\*.dll" -Exclude *.resources.dll)
20-
{
21-
if($project.Object.AnalyzerReferences)
22-
{
23-
$project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName)
24-
}
25-
}
26-
}
27-
}
28-
29-
# $project.Type gives the language name like (C# or VB.NET)
30-
$languageFolder = ""
31-
if($project.Type -eq "C#")
32-
{
33-
$languageFolder = "cs"
34-
}
35-
if($project.Type -eq "VB.NET")
36-
{
37-
$languageFolder = "vb"
38-
}
39-
if($languageFolder -eq "")
40-
{
41-
return
42-
}
43-
44-
foreach($analyzersPath in $analyzersPaths)
45-
{
46-
# Uninstall language specific analyzers.
47-
$languageAnalyzersPath = join-path $analyzersPath $languageFolder
48-
if (Test-Path $languageAnalyzersPath)
49-
{
50-
foreach ($analyzerFilePath in Get-ChildItem -Path "$languageAnalyzersPath\*.dll" -Exclude *.resources.dll)
51-
{
52-
if($project.Object.AnalyzerReferences)
53-
{
54-
try
55-
{
56-
$project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName)
57-
}
58-
catch
59-
{
60-
61-
}
62-
}
63-
}
64-
}
1+
param($installPath, $toolsPath, $package, $project)
2+
3+
if($project.Object.SupportsPackageDependencyResolution)
4+
{
5+
if($project.Object.SupportsPackageDependencyResolution())
6+
{
7+
# Do not uninstall analyzers via uninstall.ps1, instead let the project system handle it.
8+
return
9+
}
10+
}
11+
12+
$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers") * -Resolve
13+
14+
foreach($analyzersPath in $analyzersPaths)
15+
{
16+
# Uninstall the language agnostic analyzers.
17+
if (Test-Path $analyzersPath)
18+
{
19+
foreach ($analyzerFilePath in Get-ChildItem -Path "$analyzersPath\*.dll" -Exclude *.resources.dll)
20+
{
21+
if($project.Object.AnalyzerReferences)
22+
{
23+
$project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName)
24+
}
25+
}
26+
}
27+
}
28+
29+
# $project.Type gives the language name like (C# or VB.NET)
30+
$languageFolder = ""
31+
if($project.Type -eq "C#")
32+
{
33+
$languageFolder = "cs"
34+
}
35+
if($project.Type -eq "VB.NET")
36+
{
37+
$languageFolder = "vb"
38+
}
39+
if($languageFolder -eq "")
40+
{
41+
return
42+
}
43+
44+
foreach($analyzersPath in $analyzersPaths)
45+
{
46+
# Uninstall language specific analyzers.
47+
$languageAnalyzersPath = join-path $analyzersPath $languageFolder
48+
if (Test-Path $languageAnalyzersPath)
49+
{
50+
foreach ($analyzerFilePath in Get-ChildItem -Path "$languageAnalyzersPath\*.dll" -Exclude *.resources.dll)
51+
{
52+
if($project.Object.AnalyzerReferences)
53+
{
54+
try
55+
{
56+
$project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName)
57+
}
58+
catch
59+
{
60+
61+
}
62+
}
63+
}
64+
}
6565
}

src/Compiler/Compiler.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
<PackageLicenseExpression>MIT</PackageLicenseExpression>
88
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
99
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
10+
<PackageProjectUrl>https://github.com/Azure/azure-api-management-policy-toolkit</PackageProjectUrl>
1011
<RepositoryUrl>https://github.com/Azure/azure-api-management-policy-toolkit</RepositoryUrl>
11-
<Description>Azure API Management Policy Toolkit compiler is a dotnet tool allowing you to transform policy document(s) from C# code to XML.</Description>
12+
<Description>
13+
Azure API Management Policy Toolkit compiler is a dotnet tool allowing you to transform policy document(s) from C# code to XML.
14+
Read more about it at https://github.com/Azure/azure-api-management-policy-toolkit
15+
</Description>
1216
<PackageTags>Azure;Azure API Management;API Gateway;API Management;Policy;Policies;Policy Toolkit;Compiler;Policy Toolkit Compiler</PackageTags>
1317
</PropertyGroup>
1418

0 commit comments

Comments
 (0)