buildtools/build.proj (354 lines of code) (raw):
<Project ToolsVersion="4.0" DefaultTargets="full-build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<InternalBuildTools Condition="'$(InternalBuildTools)'==''">../../AwsSdkDotNetBuildUtilities/BuildUtilities</InternalBuildTools>
</PropertyGroup>
<Import Project="$(InternalBuildTools)/references.targets" Condition="Exists('$(InternalBuildTools)/references.targets')" />
<PropertyGroup>
<!-- perform a release build by default -->
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
<!-- deletes the Include/sdk/assemblies folders; set to false if the content of these folders is pre-filled in with the packages to be used by the build -->
<CleanSdkReferences Condition="'$(CleanSdkReferences)'==''">true</CleanSdkReferences>
<!-- path to the root of the repo artifacts; locations for output content will be inferred from this -->
<RootPath Condition="'$(RootPath)'==''">$(MSBuildProjectDirectory)/..</RootPath>
<!-- the relative location (to the project file) of the generator executable -->
<GeneratorPath>$(RootPath)/generator/AWSPSGenerator/bin/$(Configuration)/netcoreapp3.1</GeneratorPath>
<Generator>AWSPSGenerator.dll</Generator>
<!-- expected location of SDK assemblies to be consumed by generator; these should have been fetched via
the get-references (=> get-reference-sdk) target
-->
<SDKAssembliesFolder Condition="'$(SDKAssembliesFolder)'==''">$(RootPath)/Include/sdk/assemblies</SDKAssembliesFolder>
<!-- the domain in which the China (Beijing), cn-north-1, doc assets are hosted (injected into docs) -->
<CNNorth1RegionDocsDomain Condition="'$(CNNorth1RegionDocsDomain)'==''">docs.amazonaws.cn</CNNorth1RegionDocsDomain>
<!-- build log containing results of generator analysis of service operations -->
<CmdletAnalysisLog Condition="'$(CmdletAnalysisLog)'==''">$(RootPath)/logs/CmdletAnalysis.log</CmdletAnalysisLog>
<!-- if true (default), the generator will attempt to generate cmdlets for new operations found in the SDK. Set false to perform emergency maintenance releases without needing to configure new service operations changes first. -->
<CreateNewCmdlets Condition="'$(CreateNewCmdlets)' == ''">true</CreateNewCmdlets>
<!-- set to true to build without reflecting over the service client to generate cmdlets, aliases and completers. If set to true the generator will only download the nupkg files and unzip the SDK dlls -->
<SkipCmdletGeneration Condition="'$(SkipCmdletGeneration)'==''">false</SkipCmdletGeneration>
<!-- set to true to fail the build if new operations are present in the SDK, this can be used during release builds when all configurations are expected to be already committed -->
<BreakOnNewOperations Condition="'$(BreakOnNewOperations)'==''">false</BreakOnNewOperations>
<!-- set to false to skip generating the release notes draft -->
<DraftReleaseNotes Condition="'$(DraftReleaseNotes)'==''">true</DraftReleaseNotes>
<!-- the four-components version number e.g. 4.0.0.0. -->
<PatchNumber Condition="'$(PatchNumber)'==''">0.0.0.0</PatchNumber>
<!-- default location for artifacts consolidation -->
<Deployment Condition="'$(Deployment)'==''">$(RootPath)/Deployment</Deployment>
<DesktopDeploymentArtifacts>$(Deployment)/AWSPowerShell/</DesktopDeploymentArtifacts>
<NetCoreDeploymentArtifacts>$(Deployment)/AWSPowerShell.NetCore/</NetCoreDeploymentArtifacts>
<ModularDeploymentArtifacts>$(Deployment)/AWS.Tools/</ModularDeploymentArtifacts>
<AWSPowerShellSourceFolder>$(RootPath)/modules/AWSPowerShell</AWSPowerShellSourceFolder>
<DesktopBuildFolder>$(AWSPowerShellSourceFolder)/bin/$(Configuration)/net45/</DesktopBuildFolder>
<NetCoreBuildFolder>$(AWSPowerShellSourceFolder)/bin/$(Configuration)/netstandard2.0/</NetCoreBuildFolder>
<DocDeployment Condition="'$(DocDeployment)'==''">$(RootPath)/DocDeployment</DocDeployment>
<RunTests Condition="'$(RunTests)'==''">false</RunTests>
<RunKeyScan Condition="'$(RunKeyScan)'==''">true</RunKeyScan>
<SignModules Condition="'$(SignModules)'==''">false</SignModules>
</PropertyGroup>
<!-- Import default code signing properties and the task -->
<Import Project="$(InternalBuildTools)/CodeSign.proj" Condition="'$(InternalBuildTools)'!='' And '$(SignModules)'=='true' And Exists('$(InternalBuildTools)/CodeSign.proj')" />
<Target Name="full-build" DependsOnTargets="clean-bin;clean-deployment;clean-sdk-references;build-generator;create-cmdlets;build-modules;build-test-modules;copy-coreclr-artifacts;draft-release-notes;copy-desktop-artifacts;copy-modular-artifacts;copy-tests;copy-test-module-artifacts;copy-postbuild-scripts;create-help;keyscan;sign-script-artifacts;run-tests">
<Message Text="Generates and then builds all cmdlets and PowerShell deployment artifacts, including native and web help files."/>
</Target>
<Target Name="preview-build" DependsOnTargets="clean-deployment;build-generator;create-cmdlets;build-netcore-module;build-test-modules;copy-coreclr-artifacts;copy-test-module-artifacts;draft-release-notes;copy-postbuild-scripts;create-pshelp;sign-script-artifacts-preview;run-tests">
<Message Text="Generates all cmdlets and then builds AWSPowerShell.NetCore deployment artifacts and powershell help files."/>
</Target>
<Target Name="staging-build" DependsOnTargets="clean-bin;clean-deployment;clean-sdk-references;build-generator;create-cmdlets">
<Message Text="Generates and then builds all cmdlets and PowerShell deployment artifacts."/>
</Target>
<Target Name="clean-bin">
<Exec Command="dotnet clean -c $(Configuration) ../solutions/ModularAWSPowerShell.sln"/>
<Exec Command="dotnet clean -c $(Configuration) ../solutions/AWSPowerShell.sln"/>
</Target>
<Target Name="clean-deployment">
<RemoveDir Directories="$(RootPath)\TestResults" />
<RemoveDir Directories="$(Deployment)" />
<MakeDir Directories="$(Deployment)" />
</Target>
<Target Name="clean-sdk-references" Condition="'$(CleanSdkReferences)'">
<RemoveDir Directories="$(SDKAssembliesFolder)" />
<MakeDir Directories="$(SDKAssembliesFolder)"/>
</Target>
<Target Name="build-generator">
<Message Text="Building AWS PowerShell generator"/>
<!-- Parallel restore randomly fails package certificate trust https://github.com/NuGet/Home/issues/10322 -->
<Exec Command="dotnet restore --disable-parallel ../solutions/AWSPowerShellGenerator.sln"/>
<Exec Command="dotnet build -c $(Configuration) --force --no-incremental --no-restore -p:UseSharedCompilation=false ../solutions/AWSPowerShellGenerator.sln"/>
</Target>
<Target Name="create-cmdlets" DependsOnTargets="build-generator">
<Exec Command="pwsh -NoProfile -Command Remove-Item -Path $(RootPath)/GenerationSucceeded.tag" IgnoreExitCode="true" />
<Message Text="Generating cmdlets for all services"/>
<Exec Command="dotnet $(GeneratorPath)/$(Generator) -sdk $(SDKAssembliesFolder) -rp $(RootPath) -t cmdlets -cnc $(CreateNewCmdlets) -scg $(SkipCmdletGeneration) -bno $(BreakOnNewOperations) -vn $(PatchNumber)" />
<Exec Command="pwsh -NoProfile -Command New-Item -Path $(RootPath)/GenerationSucceeded.tag" />
</Target>
<Target Name="build-modules" DependsOnTargets="build-netcore-module;build-desktop-module;build-modular-modules" />
<Target Name="build-desktop-module" DependsOnTargets="create-cmdlets;build-netcore-module">
<Message Text="Building AWSPowerShell desktop module edition"/>
<Exec Command="dotnet restore --disable-parallel ../solutions/AWSPowerShell.sln"/>
<Exec Command="dotnet build -c $(Configuration) -f net45 --force --no-incremental --no-restore -p:UseSharedCompilation=false ../solutions/AWSPowerShell.sln"/>
</Target>
<Target Name="build-netcore-module" DependsOnTargets="create-cmdlets">
<Message Text="Building AWSPowerShell netcore module edition"/>
<Exec Command="dotnet restore --disable-parallel ../solutions/AWSPowerShell.sln"/>
<Exec Command="dotnet build -c $(Configuration) -f netstandard2.0 --force --no-incremental --no-restore -p:UseSharedCompilation=false ../solutions/AWSPowerShell.sln"/>
<Message Text="Generating custom view formats ps1xml file"/>
<Exec Command="dotnet $(GeneratorPath)/$(Generator) -sdk $(SDKAssembliesFolder) -rp $(RootPath) -t formats -e coreclr" />
</Target>
<Target Name="build-modular-modules" DependsOnTargets="create-cmdlets">
<Message Text="Building AWSPowerShell modular edition"/>
<Exec Command="dotnet restore --disable-parallel ../solutions/ModularAWSPowerShell.sln"/>
<Exec Command="dotnet build -c $(Configuration) -f netstandard2.0 --force --no-incremental --no-restore -p:UseSharedCompilation=false ../solutions/ModularAWSPowerShell.sln"/>
</Target>
<Target Name="create-help" DependsOnTargets="create-pshelp;create-webhelp" />
<Target Name="create-pshelp" DependsOnTargets="build-netcore-module">
<Message Text="Generating native PowerShell help file"/>
<Exec Command="dotnet $(GeneratorPath)/$(Generator) -sdk $(SDKAssembliesFolder) -rp $(RootPath) -t pshelp -e coreclr" />
<Copy SourceFiles="$(NetCoreBuildFolder)/AWSPowerShell.NetCore.dll-Help.xml" DestinationFiles="$(NetCoreDeploymentArtifacts)/AWSPowerShell.NetCore.dll-Help.xml" />
<Copy SourceFiles="$(NetCoreBuildFolder)/AWSPowerShell.NetCore.dll-Help.xml" DestinationFiles="$(DesktopDeploymentArtifacts)/AWSPowerShell.dll-Help.xml" />
</Target>
<Target Name="create-webhelp" DependsOnTargets="build-netcore-module">
<Message Text="Generating web cmdlet reference"/>
<Exec Command="dotnet $(GeneratorPath)/$(Generator) -sdk $(SDKAssembliesFolder) -rp $(RootPath) -t webhelp -e coreclr" />
<CallTarget Targets="package-webhelp"/>
</Target>
<Target Name="package-webhelp" Condition="Exists('$(InternalBuildTools)/references.targets')">
<CreateSitemapTask SourceFolder="$(DocDeployment)/docs" BaseUrl="http://docs.aws.amazon.com/powershell/latest/reference/" OutputFile="$(DocDeployment)/docs/sitemap.xml" />
<ItemGroup>
<FilesToZip Include="$(DocDeployment)/docs/**" />
</ItemGroup>
<Zip InputDirectory="$(DocDeployment)/docs" OutputFileName="$(DocDeployment)/help.zip" />
</Target>
<Target Name="build-test-modules" DependsOnTargets="create-cmdlets">
<Message Text="Building test modules"/>
<Exec Command="dotnet restore --disable-parallel ../tests/modules/TestModule.sln"/>
<Exec Command="dotnet build -c $(Configuration) -f netstandard2.0 --force --no-incremental --no-restore -p:UseSharedCompilation=false ../tests/modules/TestModule.sln"/>
</Target>
<Target Name="run-tests" Condition="'$(RunTests)'">
<Message Text="Running tests"/>
<RemoveDir Directories="$(RootPath)/tests/results" />
<MakeDir Directories="$(RootPath)/tests/results" />
<Exec Command="pwsh -NoProfile -Command Invoke-Pester -EnableExit -OutputFile results/PesterResults.xml -OutputFormat NUnitXML -ExcludeTag Disabled -Show All" WorkingDirectory="$(RootPath)/tests" />
<ItemGroup>
<TestResults Include="$(RootPath)/test/results/*.*"/>
</ItemGroup>
<Copy SourceFiles="@(TestResults)" DestinationFolder="$(Deployment)" />
</Target>
<Target Name="copy-desktop-artifacts" DependsOnTargets="build-netcore-module;build-desktop-module">
<Message Text="Consolidating Desktop edition artifacts from $(DesktopBuildFolder) to $(DesktopDeploymentArtifacts)"/>
<ItemGroup>
<SDKAssemblies Include="$(SDKAssembliesFolder)/net45/AWSSDK.*.dll" />
</ItemGroup>
<Copy SourceFiles="@(SDKAssemblies)" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<ItemGroup>
<CRTAssemblies Include="$(SDKAssembliesFolder)/net45/aws-crt*.dll" />
</ItemGroup>
<Copy SourceFiles="@(CRTAssemblies)" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSPowerShell.psd1" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSPowerShell.TypeExtensions.ps1xml" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSAliases.ps1" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/ImportGuard.ps1" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSPowerShellCompleters.psm1" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSPowerShellLegacyAliases.psm1" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<Copy SourceFiles="$(DesktopBuildFolder)/AWSPowerShell.dll" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<Copy SourceFiles="$(DesktopBuildFolder)/AWSPowerShell.XML" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<!-- clone the generated file from coreclr -->
<Copy SourceFiles="$(NetCoreBuildFolder)/AWSPowerShell.NetCore.Format.ps1xml" DestinationFiles="$(DesktopDeploymentArtifacts)/AWSPowerShell.Format.ps1xml" />
<Copy SourceFiles="$(RootPath)/thirdparty/log4net.dll" DestinationFolder="$(DesktopDeploymentArtifacts)"/>
<Copy SourceFiles="$(RootPath)/CHANGELOG.md" DestinationFiles="$(DesktopDeploymentArtifacts)/CHANGELOG.txt"/>
<Copy SourceFiles="$(RootPath)/LICENSE" DestinationFiles="$(DesktopDeploymentArtifacts)/LICENSE"/>
<Copy SourceFiles="$(RootPath)/NOTICE" DestinationFiles="$(DesktopDeploymentArtifacts)/NOTICE"/>
</Target>
<Target Name="copy-coreclr-artifacts" DependsOnTargets="build-netcore-module">
<Message Text="Consolidating CoreCLR edition artifacts from $(NetCoreBuildFolder) to $(NetCoreDeploymentArtifacts)"/>
<ItemGroup>
<NetCoreSDKAssemblies Include="$(SDKAssembliesFolder)/netstandard2.0/AWSSDK.*.dll" />
</ItemGroup>
<Copy SourceFiles="@(NetCoreSDKAssemblies)" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<ItemGroup>
<CRTAssemblies Include="$(SDKAssembliesFolder)/netstandard2.0/aws-crt*.dll" />
</ItemGroup>
<Copy SourceFiles="@(CRTAssemblies)" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSPowerShell.NetCore.psd1" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSPowerShell.TypeExtensions.ps1xml" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSAliases.ps1" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/ImportGuard.ps1" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSPowerShellCompleters.psm1" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/AWSPowerShellLegacyAliases.psm1" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<Copy SourceFiles="$(NetCoreBuildFolder)/AWSPowerShell.NetCore.dll" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<Copy SourceFiles="$(NetCoreBuildFolder)/AWSPowerShell.NetCore.XML" DestinationFolder="$(NetCoreDeploymentArtifacts)"/>
<Copy SourceFiles="$(NetCoreBuildFolder)/AWSPowerShell.NetCore.Format.ps1xml" DestinationFolder="$(NetCoreDeploymentArtifacts)" />
<Copy SourceFiles="$(RootPath)/CHANGELOG.md" DestinationFiles="$(NetCoreDeploymentArtifacts)/CHANGELOG.txt"/>
<Copy SourceFiles="$(RootPath)/LICENSE" DestinationFiles="$(NetCoreDeploymentArtifacts)/LICENSE"/>
<Copy SourceFiles="$(RootPath)/NOTICE" DestinationFiles="$(NetCoreDeploymentArtifacts)/NOTICE"/>
</Target>
<Target Name="copy-modular-artifacts" DependsOnTargets="build-modular-modules">
<Exec Command="pwsh $(RootPath)/buildtools/CopyModularAWSPowerShell.ps1 $(RootPath) $(Configuration)"/>
</Target>
<Target Name="copy-tests">
<PropertyGroup>
<TestSourceFolder>$(RootPath)/Tests</TestSourceFolder>
</PropertyGroup>
<ItemGroup>
<TestFiles Include="$(TestSourceFolder)/**/*.*" />
</ItemGroup>
<Copy SourceFiles="@(TestFiles)" DestinationFolder="$(RootPath)/Deployment/Tests/%(RecursiveDir)" />
</Target>
<Target Name="copy-test-module-artifacts" DependsOnTargets="build-test-modules">
<PropertyGroup>
<TestModuleSourceFolder>$(RootPath)/Tests/modules/bin/$(Configuration)/netstandard2.0</TestModuleSourceFolder>
</PropertyGroup>
<Message Text="Consolidating test module artifacts from $(TestModuleSourceFolder) to $(RootPath)/Deployment/Tests/modules"/>
<ItemGroup>
<TestModuleAssemblies Include="$(TestModuleSourceFolder)/*.dll" />
</ItemGroup>
<RemoveDir Directories="$(RootPath)/Deployment/Tests/modules" />
<Copy SourceFiles="@(TestModuleAssemblies)" DestinationFolder="$(RootPath)/Deployment/Tests/modules" />
</Target>
<Target Name="copy-postbuild-scripts">
<ItemGroup>
<PostBuildScripts Include="$(RootPath)/buildtools/Confirm-StagedArtifact.ps1" />
<PostBuildScripts Include="$(RootPath)/buildtools/Publish-StagedArtifact.ps1" />
<PostBuildScripts Include="$(RootPath)/buildtools/Update-ModulePackageVersion.psm1" />
</ItemGroup>
<Copy SourceFiles="@(PostBuildScripts)" DestinationFolder="$(RootPath)/Deployment" />
<!-- emit the version data into a json file that gets uploaded to S3. EC2 then
reads this to know if it needs to update EC2 images during image prep. -->
<Copy SourceFiles="$(AWSPowerShellSourceFolder)/awspowershell_versioninfo.json" DestinationFolder="$(RootPath)/Deployment" />
</Target>
<Target Name="sign-script-artifacts" Condition="'$(SignModules)'=='true'" DependsOnTargets="copy-desktop-artifacts;copy-coreclr-artifacts">
<!-- Configure project specfic code sign properties -->
<ItemGroup>
<!-- Desktop Edition -->
<SignableItems Include="$(DesktopDeploymentArtifacts)*.ps1" />
<SignableItems Include="$(DesktopDeploymentArtifacts)*.psm1" />
<SignableItems Include="$(DesktopDeploymentArtifacts)*.psd1" />
<SignableItems Include="$(DesktopDeploymentArtifacts)*.ps1xml" />
<SignableItems Include="$(DesktopDeploymentArtifacts)AWSPowerShell.dll" />
<!-- NetCore Edition -->
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.ps1" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.psm1" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.psd1" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.ps1xml" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)AWSPowerShell.NetCore.dll" />
<!-- Modular Edition -->
<SignableItems Include="$(ModularDeploymentArtifacts)**/*.ps1" />
<SignableItems Include="$(ModularDeploymentArtifacts)**/*.psm1" />
<SignableItems Include="$(ModularDeploymentArtifacts)**/*.psd1" />
<SignableItems Include="$(ModularDeploymentArtifacts)**/*.ps1xml" />
<SignableItems Include="$(ModularDeploymentArtifacts)**/AWS.Tools.*.dll" />
</ItemGroup>
<PropertyGroup>
<SignableItemsBasePath>$(Deployment)</SignableItemsBasePath>
<ZipPrefix>powershell</ZipPrefix>
<ZipFilesPath>$(RootPath)/codesign-zip</ZipFilesPath>
<SigningS3KeyPrefix>powershell</SigningS3KeyPrefix>
<SignedItemsPath>$(Deployment)</SignedItemsPath>
<SigningRoleSessionName>powershell-signer-session</SigningRoleSessionName>
</PropertyGroup>
<CodeSignTask
SignableItemsBasePath="$(SignableItemsBasePath)"
SignableItems="@(SignableItems)"
ZipItemsBeforeSigning="$(ZipItemsBeforeSigning)"
ZipPrefix="$(ZipPrefix)"
NumberOfFilesPerZip="$(NumberOfFilesPerZip)"
ZipFilesPath="$(ZipFilesPath)"
SigningProfileName="$(SigningProfileName)"
SigningRoleArn="$(SigningRoleArn)"
SigningRoleSessionName="$(SigningRoleSessionName)"
SigningBucketRegion="$(SigningBucketRegion)"
SignerServiceRegion="$(SignerServiceRegion)"
UnsignedBucketName="$(UnsignedBucketName)"
SigningS3Folder="$(SigningS3Folder)"
SigningS3KeyPrefix="$(SigningS3KeyPrefix)"
SigningInitialQueryStatusDelay="$(SigningInitialQueryStatusDelay)"
SignedItemsPath="$(SignedItemsPath)"
KeepZippedSignedFiles="$(KeepZippedSignedFiles)"
S3TagPollingInvervalMilliseconds="$(S3TagPollingInvervalMilliseconds)"
JobCompletionPollingInvervalMilliseconds="$(JobCompletionPollingInvervalMilliseconds)">
<Output TaskParameter="ZipFiles" ItemName="FileWrites" />
<Output TaskParameter="ZipFiles" ItemName="SigningZipFiles" />
<Output TaskParameter="SignableArtifacts" ItemName="SignableArtifacts" />
<Output TaskParameter="DownloadedSignedItems" ItemName="FileWrites" />
<Output TaskParameter="DownloadedSignedItems" ItemName="DownloadedSignedItems" />
</CodeSignTask>
</Target>
<Target Name="sign-script-artifacts-preview" Condition="'$(SignModules)'=='true'" DependsOnTargets="copy-coreclr-artifacts">
<!-- Configure project specfic code sign properties -->
<ItemGroup>
<!-- NetCore Edition -->
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.ps1" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.psm1" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.psd1" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.ps1xml" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)AWSPowerShell.NetCore.dll" />
</ItemGroup>
<PropertyGroup>
<SignableItemsBasePath>$(Deployment)</SignableItemsBasePath>
<ZipPrefix>powershell</ZipPrefix>
<ZipFilesPath>$(RootPath)/codesign-zip</ZipFilesPath>
<SigningS3KeyPrefix>powershell</SigningS3KeyPrefix>
<SignedItemsPath>$(Deployment)</SignedItemsPath>
<SigningRoleSessionName>powershell-signer-session</SigningRoleSessionName>
</PropertyGroup>
<CodeSignTask
SignableItemsBasePath="$(SignableItemsBasePath)"
SignableItems="@(SignableItems)"
ZipItemsBeforeSigning="$(ZipItemsBeforeSigning)"
ZipPrefix="$(ZipPrefix)"
NumberOfFilesPerZip="$(NumberOfFilesPerZip)"
ZipFilesPath="$(ZipFilesPath)"
SigningProfileName="$(SigningProfileName)"
SigningRoleArn="$(SigningRoleArn)"
SigningRoleSessionName="$(SigningRoleSessionName)"
SigningBucketRegion="$(SigningBucketRegion)"
SignerServiceRegion="$(SignerServiceRegion)"
UnsignedBucketName="$(UnsignedBucketName)"
SigningS3Folder="$(SigningS3Folder)"
SigningS3KeyPrefix="$(SigningS3KeyPrefix)"
SigningInitialQueryStatusDelay="$(SigningInitialQueryStatusDelay)"
SignedItemsPath="$(SignedItemsPath)"
KeepZippedSignedFiles="$(KeepZippedSignedFiles)"
S3TagPollingInvervalMilliseconds="$(S3TagPollingInvervalMilliseconds)"
JobCompletionPollingInvervalMilliseconds="$(JobCompletionPollingInvervalMilliseconds)">
<Output TaskParameter="ZipFiles" ItemName="FileWrites" />
<Output TaskParameter="ZipFiles" ItemName="SigningZipFiles" />
<Output TaskParameter="SignableArtifacts" ItemName="SignableArtifacts" />
<Output TaskParameter="DownloadedSignedItems" ItemName="FileWrites" />
<Output TaskParameter="DownloadedSignedItems" ItemName="DownloadedSignedItems" />
</CodeSignTask>
</Target>
<Target Name="keyscan" DependsOnTargets="build-tools" Condition="$(RunKeyScan) And Exists('$(InternalBuildTools)/references.targets')">
<!-- note that paths to files for the scanner should be relative to build root -->
<ItemGroup>
<PrivateKeyException Include="generator\AWSPSGeneratorLib\HelpMaterials\Examples\EC2\New-EC2KeyPair.xml" />
<PrivateKeyException Include="generator\AWSPSGeneratorLib\HelpMaterials\Examples\IAM\Get-IAMServerCertificate.xml" />
<PrivateKeyException Include="generator\AWSPSGeneratorLib\HelpMaterials\Examples\IAM\Get-IAMSigningCertificate.xml" />
<PrivateKeyException Include="generator\AWSPSGeneratorLib\HelpMaterials\Examples\IAM\Publish-IAMSigningCertificate.xml" />
<PrivateKeyException Include=".doc_gen\metadata\ec2_New-EC2KeyPair_metadata.yaml" />
<PrivateKeyException Include=".doc_gen\metadata\iam_Get-IAMServerCertificate_metadata.yaml" />
<PrivateKeyException Include=".doc_gen\metadata\iam_Get-IAMSigningCertificate_metadata.yaml" />
<PrivateKeyException Include=".doc_gen\metadata\iam_Publish-IAMSigningCertificate_metadata.yaml" />
<PrivateKeyException Include="Deployment\AWSPowerShell\AWSPowerShell.dll-Help.xml" />
<PrivateKeyException Include="Deployment\AWSPowerShell.NetCore\AWSPowerShell.NetCore.dll-Help.xml" />
<PrivateKeyException Include="Deployment\AWS.Tools\AWS.Tools.EC2\AWS.Tools.EC2.dll-Help.xml" />
<PrivateKeyException Include="Deployment\AWS.Tools\AWS.Tools.IdentityManagement\AWS.Tools.IdentityManagement.dll-Help.xml" />
<PrivateKeyException Include="DocDeployment\docs\items\New-EC2KeyPair.html" />
<PrivateKeyException Include="DocDeployment\docs\items\Get-IAMServerCertificate.html" />
<PrivateKeyException Include="DocDeployment\docs\items\Get-IAMSigningCertificate.html" />
<PrivateKeyException Include="DocDeployment\docs\items\Publish-IAMSigningCertificate.html" />
</ItemGroup>
<ItemGroup>
<FileException Include="test/temp/test-credentials-correct" />
<FileException Include="Include/sdk/Models/elasticbeanstalk.examples.json" />
<FileException Include="Include/sdk/Models/elasticbeanstalk.customizations.json" />
</ItemGroup>
<!-- Exclude the text files from KeyScanner until signature block exclusion is implemented in the build task -->
<!-- The list of items must be in sync with the items in Signing task above -->
<ItemGroup>
<!-- Desktop Edition -->
<SignableItems Include="$(DesktopDeploymentArtifacts)*.ps1" />
<SignableItems Include="$(DesktopDeploymentArtifacts)*.psm1" />
<SignableItems Include="$(DesktopDeploymentArtifacts)*.psd1" />
<SignableItems Include="$(DesktopDeploymentArtifacts)*.ps1xml" />
<SignableItems Include="$(DesktopDeploymentArtifacts)AWSPowerShell.dll" />
<!-- NetCore Edition -->
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.ps1" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.psm1" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.psd1" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)*.ps1xml" />
<SignableItems Include="$(NetCoreDeploymentArtifacts)AWSPowerShell.NetCore.dll" />
<!-- Modular Edition -->
<SignableItems Include="$(ModularDeploymentArtifacts)**/*.ps1" />
<SignableItems Include="$(ModularDeploymentArtifacts)**/*.psm1" />
<SignableItems Include="$(ModularDeploymentArtifacts)**/*.psd1" />
<SignableItems Include="$(ModularDeploymentArtifacts)**/*.ps1xml" />
<SignableItems Include="$(ModularDeploymentArtifacts)**/AWS.Tools.*.dll" />
</ItemGroup>
<ItemGroup>
<SignableItemsWithRelativePath Include="@(SignableItems)" Exclude="*.dll" >
<RelativePath>$([MSBuild]::MakeRelative($(RootPath), %(SignableItems.FullPath)))</RelativePath>
</SignableItemsWithRelativePath>
<FileException Include="%(SignableItemsWithRelativePath.RelativePath)" />
</ItemGroup>
<ItemGroup>
<FolderException Include="Include/sdk/models"/>
<FolderException Include="PSGalleryDownloads"/>
<FolderException Include="Include/sdk/assemblies"/>
</ItemGroup>
<KeyScannerTask Folder="$(MSBuildProjectDirectory)/.." FilePattern="**" PrivateKeyExceptions="@(PrivateKeyException)" FileExceptions="@(FileException)" FolderExceptions="@(FolderException)" ParallelScan="true" />
</Target>
<Target Name="draft-release-notes" Condition="$(DraftReleaseNotes)">
<Exec Command="dotnet restore --disable-parallel ../solutions/ReleaseNotesGenerator.sln"/>
<Exec Command="dotnet build -c Release --no-incremental --no-restore -p:UseSharedCompilation=false ../solutions/ReleaseNotesGenerator.sln"/>
<Exec Condition="'$(PreviousVersionPath)'==''" Command="dotnet $(MSBuildProjectDirectory)/../generator/ReleaseNotesGenerator/bin/Release/netcoreapp3.1/ReleaseNotesGenerator.dll -na $(NetCoreDeploymentArtifacts)/AWSPowerShell.NetCore.dll -mn AWSPowerShell.NetCore -df ../PSGalleryDownloads/ -an AWSPowerShell.NetCore.dll -vf ../Include/sdk/_sdk-versions.json -of ../ReleaseNotesDraft.txt -bc ../BreakingChangesLookup.xml -or ../overrides.xml" />
<Exec Condition="'$(PreviousVersionPath)'!=''" Command="dotnet $(MSBuildProjectDirectory)/../generator/ReleaseNotesGenerator/bin/Release/netcoreapp3.1/ReleaseNotesGenerator.dll -na $(NetCoreDeploymentArtifacts)/AWSPowerShell.NetCore.dll -oa $(PreviousVersionPath) -vf ../Include/sdk/_sdk-versions.json -of ../ReleaseNotesDraft.txt -bc ../BreakingChangesLookup.xml -or ../overrides.xml"/>
</Target>
</Project>