Skip to content

Remove Annotation nuspec file #1842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/aws-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
pull_request:
branches:
- main
- master
- dev
- 'feature/**'

Expand Down
3 changes: 0 additions & 3 deletions Libraries/Libraries.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.0.31717.71
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{AAB54E74-20B1-42ED-BC3D-CE9F7BC7FD12}"
ProjectSection(SolutionItems) = preProject
src\Amazon.Lambda.Annotations.nuspec = src\Amazon.Lambda.Annotations.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A101C2F7-C63F-4FDE-94BB-DFA637EBEA44}"
ProjectSection(SolutionItems) = preProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyVersion>1.5.2</AssemblyVersion>
<TargetFramework>netstandard2.0</TargetFramework>

<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>

<Authors>Amazon Web Services</Authors>
<PackageTags>AWS Amazon Lambda</PackageTags>
<Description>Annotations that can be added to Lambda projects to generate C# code and CloudFormation templates.</Description>
<PackageProjectUrl>https://github.com/aws/aws-lambda-dotnet</PackageProjectUrl>
<PackageIcon>images\icon.png</PackageIcon>
<PackageReadmeFile>docs\README.md</PackageReadmeFile>

<!--This assembly needs to access internal methods inside the Amazon.Lambda.Annotations assembly.
Both these assemblies need to be strongly signed for the InternalsVisibleTo attribute to take effect.-->
<AssemblyOriginatorKeyFile>..\..\..\buildtools\public.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>

<!-- This is required to allow copying all the dependencies to bin directory which can be copied after to nuget package based on nuspec -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IncludeBuildOutput>false</IncludeBuildOutput>

<Version>1.5.3</Version>
</PropertyGroup>

<!-- Delay setting the package id till after resolving dependencies to avoid ambigious errors. -->
<Target Name="SetPackageId" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<PackageId>Amazon.Lambda.Annotations</PackageId>
</PropertyGroup>
</Target>

<ItemGroup>
<None Include="$(OutputPath)\netstandard2.0\Amazon.Lambda.Annotations.dll" Pack="true" PackagePath="lib/netstandard2.0" Visible="false" />
<None Include="$(OutputPath)\netstandard2.0\Amazon.Lambda.Annotations.xml" Pack="true" PackagePath="lib/netstandard2.0" Visible="false" />
<None Include="$(OutputPath)\net6.0\Amazon.Lambda.Annotations.dll" Pack="true" PackagePath="lib/net6.0" Visible="false" />
<None Include="$(OutputPath)\net6.0\Amazon.Lambda.Annotations.xml" Pack="true" PackagePath="lib/net6.0" Visible="false" />
<None Include="$(OutputPath)\net8.0\Amazon.Lambda.Annotations.dll" Pack="true" PackagePath="lib/net8.0" Visible="false" />
<None Include="$(OutputPath)\net8.0\Amazon.Lambda.Annotations.xml" Pack="true" PackagePath="lib/net8.0" Visible="false" />

<None Include="$(OutputPath)\netstandard2.0\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)\netstandard2.0\Amazon.Lambda.Annotations.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)\netstandard2.0\Newtonsoft.Json.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)\netstandard2.0\YamlDotNet.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageReference Include="System.CodeDom" Version="6.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all" />
<PackageReference Include="System.CodeDom" Version="6.0.0" PrivateAssets="all" />
</ItemGroup>

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

<ItemGroup>
<ProjectReference Include="..\Amazon.Lambda.Annotations\Amazon.Lambda.Annotations.csproj" OutputItemType="Analyzer" />
<ProjectReference Include="..\Amazon.Lambda.Annotations\Amazon.Lambda.Annotations.csproj" OutputItemType="Analyzer">
<ExcludeAssets>All</ExcludeAssets>
</ProjectReference>
<ProjectReference Include="..\Amazon.Lambda.Core\Amazon.Lambda.Core.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -109,4 +141,10 @@
<AdditionalFiles Include="Diagnostics\AnalyzerReleases.Unshipped.md" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\..\icon.png" Pack="true" PackagePath="images\icon.png" />
<None Include="..\Amazon.Lambda.Annotations\README.md" Pack="true" PackagePath="docs\README.md" />
<None Include="..\Amazon.Lambda.Annotations\THIRD_PARTY_LICENSES" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,50 @@ AWSLambda0113 | AWSLambdaCSharpGenerator | Error | The GenerateMain global prope
AWSLambda0114 | AWSLambdaCSharpGenerator | Error | The GenerateMain global property is set to true, but the project already contains a static Main method

## Release 1.0.0
### New Rules

Rule ID | Category | Severity | Notes
--------|----------|----------|-------
AWSLambda0110 | AWSLambdaCSharpGenerator | Error | Invalid Parameter Attribute Name

## Release 0.13.4.0
### New Rules

Rule ID | Category | Severity | Notes
--------|----------|----------|-------
AWSLambda0109 | AWSLambdaCSharpGenerator | Error | Unsupported Method Paramater Type

## Release 0.13.3.0
### New Rules

Rule ID | Category | Severity | Notes
--------|----------|----------|-------
AWSLambda0108 | AWSLambdaCSharpGenerator | Error | Assembly attribute Amazon.Lambda.Core.LambdaSerializerAttribute is missing

## Release 0.13.1.0
Rule ID | Category | Severity | Notes
--------|----------|----------|-------
AWSLambda0107 | AWSLambdaCSharpGenerator | Error | Unsupported error thrown during code generation
### New Rules

Rule ID | Category | Severity | Notes
--------|----------|----------|-------
AWSLambda0106 | AWSLambdaCSharpGenerator | Error | Invalid CloudFormation resource name
AWSLambda0107 | AWSLambdaCSharpGenerator | Error | Unsupported error thrown during code generation

## Release 0.13.0.0
### New Rules

Rule ID | Category | Severity | Notes
--------|----------|----------|-------
AWSLambda0106 | AWSLambdaCSharpGenerator | Error | Invalid CloudFormation resource name


## Release 0.11.0.0
### New Rules

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

## Release 0.4.2.0

### New Rules

Rule ID | Category | Severity | Notes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Reflection;

namespace Amazon.Lambda.Annotations.SourceGenerator.Extensions
{
Expand All @@ -12,6 +13,15 @@ public static string ToCamelCase(this string str)
}
return str;
}

public static string ApplyReplacements(this string str)
{
var generatorType = typeof(Generator);
var generatorAssembly = generatorType.Assembly;
var assemblyName = generatorAssembly.GetName();
var assemblyVersion = assemblyName.Version;
return str.Replace("{ANNOTATIONS_ASSEMBLY_VERSION}", assemblyVersion?.ToString());
}
}

public static class ExceptionExtensions
Expand Down
36 changes: 0 additions & 36 deletions Libraries/src/Amazon.Lambda.Annotations.nuspec

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class HttpApiAttribute : Attribute
/// <inheritdoc cref="LambdaHttpMethod"/>
public LambdaHttpMethod Method { get; set; }

/// <summary>
/// Constructs a <see cref="HttpApiAttribute"/>
/// </summary>
public HttpApiAttribute(LambdaHttpMethod method, string template)
{
Template = template;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ namespace Amazon.Lambda.Annotations.APIGateway
/// </summary>
public enum HttpApiVersion
{
/// <summary>
/// API Gateway HTTP API V1
/// </summary>
V1,
/// <summary>
/// API Gateway HTTP API V2
/// </summary>
V2
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,37 @@ namespace Amazon.Lambda.Annotations.APIGateway
/// </summary>
public enum LambdaHttpMethod
{
/// <summary>
/// Any HTTP Method/Verb
/// </summary>
Any,
/// <summary>
/// GET HTTP Method/Verb
/// </summary>
Get,
/// <summary>
/// POST HTTP Method/Verb
/// </summary>
Post,
/// <summary>
/// PUT HTTP Method/Verb
/// </summary>
Put,
/// <summary>
/// PATCH HTTP Method/Verb
/// </summary>
Patch,
/// <summary>
/// HEAD HTTP Method/Verb
/// </summary>
Head,
/// <summary>
/// DELETE HTTP Method/Verb
/// </summary>
Delete,
/// <summary>
/// OPTIONS HTTP Method/Verb
/// </summary>
Options
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public class RestApiAttribute : Attribute
/// <inheritdoc cref="LambdaHttpMethod" />
public LambdaHttpMethod Method { get; set; }

/// <summary>
/// Constructs a <see cref="RestApiAttribute"/>
/// </summary>
public RestApiAttribute(LambdaHttpMethod method, string template)
{
Template = template;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyVersion>1.5.2</AssemblyVersion>
<RootNamespace>Amazon.Lambda.Annotations</RootNamespace>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<IsPackable>false</IsPackable>

<!--This assembly contains some internal methods that need to be accessed by the Amazon.Lambda.Annotations.SourceGenerator assembly.
Both these assemblies need to be strongly signed for the InternalsVisibleTo attribute to take effect.-->
<AssemblyOriginatorKeyFile>..\..\..\buildtools\public.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>

<Version>1.5.3</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
Expand Down
6 changes: 6 additions & 0 deletions Libraries/src/Amazon.Lambda.Annotations/INamedAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
namespace Amazon.Lambda.Annotations
{
/// <summary>
/// Interface for a named attribute
/// </summary>
public interface INamedAttribute
{
/// <summary>
/// Name of the attribute
/// </summary>
string Name { get; set; }
}
}
6 changes: 6 additions & 0 deletions Libraries/src/Amazon.Lambda.Annotations/LambdaPackageType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
/// </summary>
public enum LambdaPackageType
{
/// <summary>
/// A Zip deployment package type
/// </summary>
Zip=0,
/// <summary>
/// An Image deployment package type
/// </summary>
Image=1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</PackageReference>
<PackageReference Include="AWSSDK.Core" Version="3.7.103.24" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeRefactoring.Testing.XUnit" Version="1.1.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

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

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

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

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

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

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

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

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static void SetExecutionEnvironment()
envValue.Append($"{Environment.GetEnvironmentVariable(envName)}_");
}

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

Environment.SetEnvironmentVariable(envName, envValue.ToString());
}
Expand Down
Loading
Loading