Skip to content

Commit ae2ae70

Browse files
committed
Remove Annotation nuspec file (#1842)
1 parent 5d11116 commit ae2ae70

File tree

72 files changed

+593
-527
lines changed

Some content is hidden

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

72 files changed

+593
-527
lines changed

Diff for: .github/workflows/aws-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
workflow_dispatch:
66
pull_request:
77
branches:
8-
- main
8+
- master
99
- dev
1010
- 'feature/**'
1111

Diff for: Libraries/Libraries.sln

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
44
VisualStudioVersion = 17.0.31717.71
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{AAB54E74-20B1-42ED-BC3D-CE9F7BC7FD12}"
7-
ProjectSection(SolutionItems) = preProject
8-
src\Amazon.Lambda.Annotations.nuspec = src\Amazon.Lambda.Annotations.nuspec
9-
EndProjectSection
107
EndProject
118
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A101C2F7-C63F-4FDE-94BB-DFA637EBEA44}"
129
ProjectSection(SolutionItems) = preProject

Diff for: Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj

+46-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,55 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<AssemblyVersion>1.5.2</AssemblyVersion>
5-
<TargetFramework>netstandard2.0</TargetFramework>
6-
4+
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
5+
6+
<Authors>Amazon Web Services</Authors>
7+
<PackageTags>AWS Amazon Lambda</PackageTags>
8+
<Description>Annotations that can be added to Lambda projects to generate C# code and CloudFormation templates.</Description>
9+
<PackageProjectUrl>https://github.com/aws/aws-lambda-dotnet</PackageProjectUrl>
10+
<PackageIcon>images\icon.png</PackageIcon>
11+
<PackageReadmeFile>docs\README.md</PackageReadmeFile>
12+
713
<!--This assembly needs to access internal methods inside the Amazon.Lambda.Annotations assembly.
814
Both these assemblies need to be strongly signed for the InternalsVisibleTo attribute to take effect.-->
915
<AssemblyOriginatorKeyFile>..\..\..\buildtools\public.snk</AssemblyOriginatorKeyFile>
1016
<SignAssembly>true</SignAssembly>
1117

1218
<!-- This is required to allow copying all the dependencies to bin directory which can be copied after to nuget package based on nuspec -->
1319
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
20+
<IncludeBuildOutput>false</IncludeBuildOutput>
21+
22+
<Version>1.5.3</Version>
1423
</PropertyGroup>
24+
25+
<!-- Delay setting the package id till after resolving dependencies to avoid ambigious errors. -->
26+
<Target Name="SetPackageId" BeforeTargets="GenerateNuspec">
27+
<PropertyGroup>
28+
<PackageId>Amazon.Lambda.Annotations</PackageId>
29+
</PropertyGroup>
30+
</Target>
31+
32+
<ItemGroup>
33+
<None Include="$(OutputPath)\netstandard2.0\Amazon.Lambda.Annotations.dll" Pack="true" PackagePath="lib/netstandard2.0" Visible="false" />
34+
<None Include="$(OutputPath)\netstandard2.0\Amazon.Lambda.Annotations.xml" Pack="true" PackagePath="lib/netstandard2.0" Visible="false" />
35+
<None Include="$(OutputPath)\net6.0\Amazon.Lambda.Annotations.dll" Pack="true" PackagePath="lib/net6.0" Visible="false" />
36+
<None Include="$(OutputPath)\net6.0\Amazon.Lambda.Annotations.xml" Pack="true" PackagePath="lib/net6.0" Visible="false" />
37+
<None Include="$(OutputPath)\net8.0\Amazon.Lambda.Annotations.dll" Pack="true" PackagePath="lib/net8.0" Visible="false" />
38+
<None Include="$(OutputPath)\net8.0\Amazon.Lambda.Annotations.xml" Pack="true" PackagePath="lib/net8.0" Visible="false" />
39+
40+
<None Include="$(OutputPath)\netstandard2.0\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
41+
<None Include="$(OutputPath)\netstandard2.0\Amazon.Lambda.Annotations.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
42+
<None Include="$(OutputPath)\netstandard2.0\Newtonsoft.Json.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
43+
<None Include="$(OutputPath)\netstandard2.0\YamlDotNet.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
44+
</ItemGroup>
1545

1646
<ItemGroup>
17-
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1" />
18-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
19-
<PackageReference Include="System.CodeDom" Version="6.0.0" />
47+
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1" PrivateAssets="all" />
48+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all" />
49+
<PackageReference Include="System.CodeDom" Version="6.0.0" PrivateAssets="all" />
2050
</ItemGroup>
2151

2252
<ItemGroup>
23-
<!-- Generator dependencies, update Libraries/src/Amazon.Lambda.Annotations.nuspec whenever a new generator dependency is added. -->
2453
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" GeneratePathProperty="true" PrivateAssets="all" />
2554
<PackageReference Include="YamlDotNet" Version="12.0.0" GeneratePathProperty="true" PrivateAssets="all" />
2655
</ItemGroup>
@@ -37,7 +66,10 @@
3766
</Target>
3867

3968
<ItemGroup>
40-
<ProjectReference Include="..\Amazon.Lambda.Annotations\Amazon.Lambda.Annotations.csproj" OutputItemType="Analyzer" />
69+
<ProjectReference Include="..\Amazon.Lambda.Annotations\Amazon.Lambda.Annotations.csproj" OutputItemType="Analyzer">
70+
<ExcludeAssets>All</ExcludeAssets>
71+
</ProjectReference>
72+
<ProjectReference Include="..\Amazon.Lambda.Core\Amazon.Lambda.Core.csproj" />
4173
</ItemGroup>
4274

4375
<ItemGroup>
@@ -109,4 +141,10 @@
109141
<AdditionalFiles Include="Diagnostics\AnalyzerReleases.Unshipped.md" />
110142
</ItemGroup>
111143

144+
<ItemGroup>
145+
<None Include="..\..\..\icon.png" Pack="true" PackagePath="images\icon.png" />
146+
<None Include="..\Amazon.Lambda.Annotations\README.md" Pack="true" PackagePath="docs\README.md" />
147+
<None Include="..\Amazon.Lambda.Annotations\THIRD_PARTY_LICENSES" Pack="true" PackagePath="" />
148+
</ItemGroup>
149+
112150
</Project>

Diff for: Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Diagnostics/AnalyzerReleases.Shipped.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -28,45 +28,50 @@ AWSLambda0113 | AWSLambdaCSharpGenerator | Error | The GenerateMain global prope
2828
AWSLambda0114 | AWSLambdaCSharpGenerator | Error | The GenerateMain global property is set to true, but the project already contains a static Main method
2929

3030
## Release 1.0.0
31+
### New Rules
32+
3133
Rule ID | Category | Severity | Notes
3234
--------|----------|----------|-------
3335
AWSLambda0110 | AWSLambdaCSharpGenerator | Error | Invalid Parameter Attribute Name
3436

3537
## Release 0.13.4.0
38+
### New Rules
39+
3640
Rule ID | Category | Severity | Notes
3741
--------|----------|----------|-------
3842
AWSLambda0109 | AWSLambdaCSharpGenerator | Error | Unsupported Method Paramater Type
3943

4044
## Release 0.13.3.0
45+
### New Rules
46+
4147
Rule ID | Category | Severity | Notes
4248
--------|----------|----------|-------
4349
AWSLambda0108 | AWSLambdaCSharpGenerator | Error | Assembly attribute Amazon.Lambda.Core.LambdaSerializerAttribute is missing
4450

4551
## Release 0.13.1.0
46-
Rule ID | Category | Severity | Notes
47-
--------|----------|----------|-------
48-
AWSLambda0107 | AWSLambdaCSharpGenerator | Error | Unsupported error thrown during code generation
52+
### New Rules
4953

5054
Rule ID | Category | Severity | Notes
5155
--------|----------|----------|-------
52-
AWSLambda0106 | AWSLambdaCSharpGenerator | Error | Invalid CloudFormation resource name
56+
AWSLambda0107 | AWSLambdaCSharpGenerator | Error | Unsupported error thrown during code generation
5357

5458
## Release 0.13.0.0
59+
### New Rules
5560

5661
Rule ID | Category | Severity | Notes
5762
--------|----------|----------|-------
5863
AWSLambda0106 | AWSLambdaCSharpGenerator | Error | Invalid CloudFormation resource name
5964

6065

6166
## Release 0.11.0.0
67+
### New Rules
6268

6369
Rule ID | Category | Severity | Notes
6470
--------|----------|----------|-------
6571
AWSLambda0104 | AWSLambdaCSharpGenerator | Error | Missing reference to a required dependency
6672
AWSLambda0105 | AWSLambdaCSharpGenerator | Error | Invalid return type IHttpResult
6773

6874
## Release 0.4.2.0
69-
7075
### New Rules
7176

7277
Rule ID | Category | Severity | Notes

Diff for: Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Extensions/StringExtensions.cs

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Reflection;
23

34
namespace Amazon.Lambda.Annotations.SourceGenerator.Extensions
45
{
@@ -12,6 +13,15 @@ public static string ToCamelCase(this string str)
1213
}
1314
return str;
1415
}
16+
17+
public static string ApplyReplacements(this string str)
18+
{
19+
var generatorType = typeof(Generator);
20+
var generatorAssembly = generatorType.Assembly;
21+
var assemblyName = generatorAssembly.GetName();
22+
var assemblyVersion = assemblyName.Version;
23+
return str.Replace("{ANNOTATIONS_ASSEMBLY_VERSION}", assemblyVersion?.ToString());
24+
}
1525
}
1626

1727
public static class ExceptionExtensions

Diff for: Libraries/src/Amazon.Lambda.Annotations.nuspec

-36
This file was deleted.

Diff for: Libraries/src/Amazon.Lambda.Annotations/APIGateway/HttpApiAttribute.cs

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public class HttpApiAttribute : Attribute
2222
/// <inheritdoc cref="LambdaHttpMethod"/>
2323
public LambdaHttpMethod Method { get; set; }
2424

25+
/// <summary>
26+
/// Constructs a <see cref="HttpApiAttribute"/>
27+
/// </summary>
2528
public HttpApiAttribute(LambdaHttpMethod method, string template)
2629
{
2730
Template = template;

Diff for: Libraries/src/Amazon.Lambda.Annotations/APIGateway/HttpApiVersion.cs

+6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ namespace Amazon.Lambda.Annotations.APIGateway
66
/// </summary>
77
public enum HttpApiVersion
88
{
9+
/// <summary>
10+
/// API Gateway HTTP API V1
11+
/// </summary>
912
V1,
13+
/// <summary>
14+
/// API Gateway HTTP API V2
15+
/// </summary>
1016
V2
1117
}
1218
}

Diff for: Libraries/src/Amazon.Lambda.Annotations/APIGateway/LambdaHttpMethod.cs

+24
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,37 @@ namespace Amazon.Lambda.Annotations.APIGateway
55
/// </summary>
66
public enum LambdaHttpMethod
77
{
8+
/// <summary>
9+
/// Any HTTP Method/Verb
10+
/// </summary>
811
Any,
12+
/// <summary>
13+
/// GET HTTP Method/Verb
14+
/// </summary>
915
Get,
16+
/// <summary>
17+
/// POST HTTP Method/Verb
18+
/// </summary>
1019
Post,
20+
/// <summary>
21+
/// PUT HTTP Method/Verb
22+
/// </summary>
1123
Put,
24+
/// <summary>
25+
/// PATCH HTTP Method/Verb
26+
/// </summary>
1227
Patch,
28+
/// <summary>
29+
/// HEAD HTTP Method/Verb
30+
/// </summary>
1331
Head,
32+
/// <summary>
33+
/// DELETE HTTP Method/Verb
34+
/// </summary>
1435
Delete,
36+
/// <summary>
37+
/// OPTIONS HTTP Method/Verb
38+
/// </summary>
1539
Options
1640
}
1741
}

Diff for: Libraries/src/Amazon.Lambda.Annotations/APIGateway/RestApiAttribute.cs

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public class RestApiAttribute : Attribute
1919
/// <inheritdoc cref="LambdaHttpMethod" />
2020
public LambdaHttpMethod Method { get; set; }
2121

22+
/// <summary>
23+
/// Constructs a <see cref="RestApiAttribute"/>
24+
/// </summary>
2225
public RestApiAttribute(LambdaHttpMethod method, string template)
2326
{
2427
Template = template;

Diff for: Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<AssemblyVersion>1.5.2</AssemblyVersion>
4+
<RootNamespace>Amazon.Lambda.Annotations</RootNamespace>
55
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7-
7+
<IsPackable>false</IsPackable>
8+
89
<!--This assembly contains some internal methods that need to be accessed by the Amazon.Lambda.Annotations.SourceGenerator assembly.
910
Both these assemblies need to be strongly signed for the InternalsVisibleTo attribute to take effect.-->
1011
<AssemblyOriginatorKeyFile>..\..\..\buildtools\public.snk</AssemblyOriginatorKeyFile>
1112
<SignAssembly>true</SignAssembly>
13+
14+
<Version>1.5.3</Version>
1215
</PropertyGroup>
1316

1417
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
namespace Amazon.Lambda.Annotations
22
{
3+
/// <summary>
4+
/// Interface for a named attribute
5+
/// </summary>
36
public interface INamedAttribute
47
{
8+
/// <summary>
9+
/// Name of the attribute
10+
/// </summary>
511
string Name { get; set; }
612
}
713
}

Diff for: Libraries/src/Amazon.Lambda.Annotations/LambdaPackageType.cs

+6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
/// </summary>
77
public enum LambdaPackageType
88
{
9+
/// <summary>
10+
/// A Zip deployment package type
11+
/// </summary>
912
Zip=0,
13+
/// <summary>
14+
/// An Image deployment package type
15+
/// </summary>
1016
Image=1
1117
}
1218
}

Diff for: Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/Amazon.Lambda.Annotations.SourceGenerators.Tests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
</PackageReference>
2424
<PackageReference Include="AWSSDK.Core" Version="3.7.103.24" />
2525
<PackageReference Include="xunit" Version="2.4.2" />
26+
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1" />
2627
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.1" />
2728
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.1" />
2829
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeRefactoring.Testing.XUnit" Version="1.1.1" />

Diff for: Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/Snapshots/ComplexCalculator_Add_Generated.g.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private static void SetExecutionEnvironment()
6969
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
7070
}
7171

72-
envValue.Append("lib/amazon-lambda-annotations#1.5.2.0");
72+
envValue.Append("lib/amazon-lambda-annotations#{ANNOTATIONS_ASSEMBLY_VERSION}");
7373

7474
Environment.SetEnvironmentVariable(envName, envValue.ToString());
7575
}

Diff for: Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/Snapshots/ComplexCalculator_Subtract_Generated.g.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private static void SetExecutionEnvironment()
9898
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
9999
}
100100

101-
envValue.Append("lib/amazon-lambda-annotations#1.5.2.0");
101+
envValue.Append("lib/amazon-lambda-annotations#{ANNOTATIONS_ASSEMBLY_VERSION}");
102102

103103
Environment.SetEnvironmentVariable(envName, envValue.ToString());
104104
}

Diff for: Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/Snapshots/CustomizeResponseExamples_NotFoundResponseWithHeaderV1Async_Generated.g.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private static void SetExecutionEnvironment()
9090
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
9191
}
9292

93-
envValue.Append("lib/amazon-lambda-annotations#1.5.2.0");
93+
envValue.Append("lib/amazon-lambda-annotations#{ANNOTATIONS_ASSEMBLY_VERSION}");
9494

9595
Environment.SetEnvironmentVariable(envName, envValue.ToString());
9696
}

Diff for: Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/Snapshots/CustomizeResponseExamples_NotFoundResponseWithHeaderV1_Generated.g.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private static void SetExecutionEnvironment()
9090
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
9191
}
9292

93-
envValue.Append("lib/amazon-lambda-annotations#1.5.2.0");
93+
envValue.Append("lib/amazon-lambda-annotations#{ANNOTATIONS_ASSEMBLY_VERSION}");
9494

9595
Environment.SetEnvironmentVariable(envName, envValue.ToString());
9696
}

Diff for: Libraries/test/Amazon.Lambda.Annotations.SourceGenerators.Tests/Snapshots/CustomizeResponseExamples_NotFoundResponseWithHeaderV2Async_Generated.g.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private static void SetExecutionEnvironment()
9090
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
9191
}
9292

93-
envValue.Append("lib/amazon-lambda-annotations#1.5.2.0");
93+
envValue.Append("lib/amazon-lambda-annotations#{ANNOTATIONS_ASSEMBLY_VERSION}");
9494

9595
Environment.SetEnvironmentVariable(envName, envValue.ToString());
9696
}

0 commit comments

Comments
 (0)