Skip to content

Commit 3655a30

Browse files
author
Ganesh Jangir
committed
feat: package analyzer and library using nupsec
1 parent 9e40a1d commit 3655a30

File tree

5 files changed

+46
-4
lines changed

5 files changed

+46
-4
lines changed

Libraries/Libraries.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ 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
710
EndProject
811
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A101C2F7-C63F-4FDE-94BB-DFA637EBEA44}"
912
ProjectSection(SolutionItems) = preProject

Libraries/src/Amazon.Lambda.Annotations.SourceGenerator/Amazon.Lambda.Annotations.SourceGenerator.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5+
6+
<!-- This is required to allow copying all the dependnceis to bin directory which can be copied after to nuget package based on nuspec -->
7+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
58
</PropertyGroup>
69

710
<ItemGroup>
@@ -11,9 +14,8 @@
1114
</ItemGroup>
1215

1316
<ItemGroup>
14-
<!-- Generator dependencies -->
17+
<!-- Generator dependencies, update Libraries/src/Amazon.Lambda.Annotations.nuspec whenever a new generator dependency is added. -->
1518
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" GeneratePathProperty="true" PrivateAssets="all" />
16-
<PackageReference Include="System.IO.Abstractions" Version="13.2.47" GeneratePathProperty="true" PrivateAssets="all" />
1719
</ItemGroup>
1820

1921
<PropertyGroup>
@@ -23,7 +25,6 @@
2325
<Target Name="GetDependencyTargetPaths">
2426
<ItemGroup>
2527
<TargetPathWithTargetPlatformMoniker Include="$(PKGNewtonsoft_Json)\lib\netstandard2.0\Newtonsoft.Json.dll" IncludeRuntimeDependency="false" />
26-
<TargetPathWithTargetPlatformMoniker Include="$(PKGSystem_IO_Abstractions)\lib\netstandard2.0\System.IO.Abstractions.dll" IncludeRuntimeDependency="false" />
2728
</ItemGroup>
2829
</Target>
2930

@@ -50,4 +51,4 @@
5051
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
5152
</ItemGroup>
5253

53-
</Project>
54+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
2+
<metadata>
3+
<id>Amazon.Lambda.Annotations</id>
4+
<version>0.1.0-preview1</version>
5+
<authors>Amazon Web Services</authors>
6+
<tags>AWS Amazon Lambda</tags>
7+
<description>Annotations that can be added to Lambda projects to generate C# code and CloudFormation templates.</description>
8+
<language>en-US</language>
9+
<projectUrl>https://github.com/aws/aws-lambda-dotnet</projectUrl>
10+
<license type="expression">Apache-2.0</license>
11+
<dependencies>
12+
<group targetFramework=".NETStandard2.0"/>
13+
</dependencies>
14+
</metadata>
15+
16+
<files>
17+
<!-- Dependencies to make sure attributes are available in consuming csproj, this ensures packaged version of customer code have all the dependencies needed. -->
18+
<file src="Amazon.Lambda.Annotations\bin\$configuration$\$targetFramework$\Amazon.Lambda.Annotations.dll" target="lib/netstandard2.0" />
19+
20+
<!-- Include every dependency manually for analyzer, whenever a new dependency is added, it has to be added here. -->
21+
<file src="Amazon.Lambda.Annotations.SourceGenerator\bin\$configuration$\$targetFramework$\Amazon.Lambda.Annotations.dll" target="analyzers\dotnet\cs" />
22+
<file src="Amazon.Lambda.Annotations.SourceGenerator\bin\$configuration$\$targetFramework$\Amazon.Lambda.Annotations.SourceGenerator.dll" target="analyzers\dotnet\cs" />
23+
<file src="Amazon.Lambda.Annotations.SourceGenerator\bin\$configuration$\$targetFramework$\Newtonsoft.Json.dll" target="analyzers\dotnet\cs" />
24+
</files>
25+
</package>

Libraries/src/Amazon.Lambda.Annotations/Amazon.Lambda.Annotations.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,11 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
</PropertyGroup>
66

7+
<Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec">
8+
<PropertyGroup>
9+
<NuspecProperties>$(NuspecProperties);configuration=$(Configuration)</NuspecProperties>
10+
<NuspecProperties>$(NuspecProperties);targetFramework=$(TargetFramework)</NuspecProperties>
11+
</PropertyGroup>
12+
</Target>
13+
714
</Project>

NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
</packageSources>
6+
</configuration>

0 commit comments

Comments
 (0)