-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathAWS.Deploy.Recipes.CDK.Common.csproj
More file actions
91 lines (76 loc) · 3.5 KB
/
AWS.Deploy.Recipes.CDK.Common.csproj
File metadata and controls
91 lines (76 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>Latest</LangVersion>
<Product>AWS .NET deployment tool CDK Utilities</Product>
<Description>Utility code used in CDK recipes used by the AWS .NET deployment tool. This package is not intended for direct usage.</Description>
<PackageId>AWS.Deploy.Recipes.CDK.Common</PackageId>
<PackageTags>AWS;Amazon;Deploy</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://github.com/aws/aws-dotnet-deploy</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Version>2.0.4</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.CDK.Lib" Version="2.231.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\LICENSE" Pack="true" PackagePath="" />
<None Include="..\..\NOTICE" Pack="true" PackagePath="" />
<None Include="..\..\THIRD_PARTY_LICENSES" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<None Include=".\README.md" Pack="true" PackagePath="" />
</ItemGroup>
<UsingTask TaskName="SetupLocalCache" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<NuGetPackage ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Code Type="Fragment" Language="cs">
<![CDATA[
var cdkProjectDirectory =
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".aws-dotnet-deploy",
"Projects");
var nugetCacheDirectory =
Path.Combine(
cdkProjectDirectory,
"nuget-cache");
Directory.CreateDirectory(nugetCacheDirectory);
File.Copy(NuGetPackage, Path.Combine(nugetCacheDirectory, Path.GetFileName(NuGetPackage)), true);
var nugetCachePackage = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".nuget",
"packages",
"aws.deploy.recipes.cdk.common"
);
if(Directory.Exists(nugetCachePackage))
{
Directory.Delete(nugetCachePackage, true);
}
var nugetConfigContent = @"
<?xml version=""1.0"" encoding=""utf-8"" ?>
<configuration>
<packageSources>
<add key=""deploy-tool-cache"" value=""./nuget-cache"" />
</packageSources>
</configuration>
".Trim();
File.WriteAllText(Path.Combine(cdkProjectDirectory, "nuget.config"), nugetConfigContent);
]]></Code>
</Task>
</UsingTask>
<Target Name="SetupNuGetCache" AfterTargets="Pack">
<SetupLocalCache NuGetPackage="$(PackageOutputAbsolutePath)\$(PackageId).$(PackageVersion).nupkg" />
</Target>
<Import Project="..\AWS.Deploy.Constants\AWS.Deploy.Constants.projitems" Label="Shared" />
</Project>