forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made indentation (somewhat) consistent in build.proj and CodeSign.tar…
…gets. Normalized asset loading for test projects.
- Loading branch information
Showing
72 changed files
with
136 additions
and
772 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,94 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<UsingTask TaskName="ESRPSignTask" AssemblyFile="$(CISignRepoPath)\tools\sdkbuildtools\tasks\MS.Az.Sdk.OnPremise.Build.Tasks.dll" /> | ||
<UsingTask TaskName="ESRPSignTask" AssemblyFile="$(CISignRepoPath)\tools\sdkbuildtools\tasks\MS.Az.Sdk.OnPremise.Build.Tasks.dll" /> | ||
|
||
<PropertyGroup> | ||
<!-- CISignRepo is an environment variable that points to ci-signing repo clone --> | ||
<CISignRepoPath>$(CISignRepo)</CISignRepoPath> | ||
</PropertyGroup> | ||
|
||
<Target Name="CodeSignBinaries" DependsOnTargets="RestoreNugetPackages;BuildMsBuildTask"> | ||
<Message Text="====> Executing CodeSignBinaries Target..." Importance="high"/> | ||
|
||
<PropertyGroup> | ||
<!-- CISignRepo is an environment variable that points to ci-signing repo clone --> | ||
<CISignRepoPath>$(CISignRepo)</CISignRepoPath> | ||
<!--public token associated with MSSharedLibKey.snk--> | ||
<StrongNameToken Condition=" '$(StrongNameToken)' == '' ">31bf3856ad364e35</StrongNameToken> | ||
</PropertyGroup> | ||
|
||
<Target Name="CodeSignBinaries" DependsOnTargets="RestoreNugetPackages;BuildMsBuildTask"> | ||
|
||
<Message Text="====> Executing CodeSignBinaries Target..." Importance="high"/> | ||
|
||
<PropertyGroup> | ||
<!--public token associated with MSSharedLibKey.snk--> | ||
<StrongNameToken Condition=" '$(StrongNameToken)' == '' ">31bf3856ad364e35</StrongNameToken> | ||
</PropertyGroup> | ||
|
||
<Message Text="----> Dlls signing section" Importance="high"/> | ||
|
||
<!-- Azure --> | ||
<ItemGroup Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore'"> | ||
<DelaySignedAssembliesToSign Include="$(PackageDirectory)\$(Configuration)\**\Microsoft*Azure*PowerShell*Cmdlets*.dll" /> | ||
<DelaySignedAssembliesToSign Include="$(PackageDirectory)\$(Configuration)\**\Microsoft.Azure.Management.Sql.Legacy.dll" /> | ||
</ItemGroup> | ||
|
||
<Message Importance="high" Text="$(PackageDirectory)\$(Configuration) does not contains any files to sign. Code sign will skip." | ||
Condition="'@(DelaySignedAssembliesToSign)' == ''" /> | ||
|
||
<ESRPSignTask | ||
CopyBackSignedFilesToOriginalLocation="true" | ||
UnsignedFileList="@(DelaySignedAssembliesToSign)" | ||
SignLogDirPath="$(LibraryRoot)dlls-signing.log" | ||
Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/> | ||
|
||
<Exec Command="$(PowerShellCommandPrefix) ". $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) "" /> | ||
|
||
<!-- Copying shortcut to be signed --> | ||
<Copy SourceFiles="$(LibraryRoot)tools\Az\Az.psm1" DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'Netcore'" /> | ||
|
||
<Message Text="----> Scripts signing section" Importance="high"/> | ||
|
||
<!-- Azure --> | ||
<ItemGroup Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore'"> | ||
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.ps1" /> | ||
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.psm1" /> | ||
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.ps1xml" /> | ||
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.js" /> | ||
</ItemGroup> | ||
|
||
<ESRPSignTask | ||
CopyBackSignedFilesToOriginalLocation="true" | ||
UnsignedFileList="@(ScriptsToSign)" | ||
SignLogDirPath="$(LibraryRoot)scripts-signing.log" | ||
Condition="!$(DelaySign) and '@(ScriptsToSign)' != ''"/> | ||
|
||
<!-- RemoveCodeSignArtifacts.ps1 --> | ||
<Message Text="----> Remove artifacts section" Importance="high"/> | ||
<Exec Command="$(PowerShellCoreCommandPrefix) "Get-ChildItem -Path $(PackageDirectory) -Recurse -Include 'Signed','Unsigned' | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction Ignore"" | ||
ContinueOnError="WarnAndContinue" | ||
IgnoreExitCode="true" /> | ||
|
||
<!-- CheckSignature.ps1 --> | ||
<Message Text="----> CheckSignature section" Importance="high"/> | ||
<Exec Command="$(PowerShellCommandPrefix) ". $(LibraryToolsFolder)\CheckSignature.ps1 -CustomPath $(PackageDirectory)\$(Configuration) "" Condition="'$(Scope)' != 'Stack'" ContinueOnError="ErrorAndContinue" /> | ||
|
||
<!-- Copy files back after signing --> | ||
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psm1" DestinationFolder="$(LibraryRoot)tools\Az" Condition="'$(Scope)' == 'Netcore'" /> | ||
</Target> | ||
|
||
<Target Name="CodeSignInstaller"> | ||
<Message Text="----> CodeSignInstaller section" Importance="high"/> | ||
<PropertyGroup> | ||
<!--public token associated with MSSharedLibKey.snk--> | ||
<StrongNameToken Condition=" '$(StrongNameToken)' == '' ">31bf3856ad364e35</StrongNameToken> | ||
</PropertyGroup> | ||
<GetFrameworkSdkPath> | ||
<Output TaskParameter="Path" PropertyName="WindowsSdkPath"/> | ||
</GetFrameworkSdkPath> | ||
|
||
<ItemGroup> | ||
<InstallersToSign Include="$(LibraryRoot)\setup\*.msi" /> | ||
</ItemGroup> | ||
|
||
<Message Importance="high" Text="$(LibraryRoot)\setup does not contain any installers to sign. Code sign will skip." | ||
Condition="'@(InstallersToSign)' == ''" /> | ||
|
||
<ESRPSignTask | ||
SignedFilesRootDirPath="$(SignedOutputRootDir)" | ||
UnsignedFileList="@(InstallersToSign)" | ||
SignLogDirPath="$(LibraryRoot)\msi-signing.log" | ||
Condition="!$(DelaySign) and '@(InstallersToSign)' != ''"/> | ||
|
||
<!--If we are testing locally then we copy the binaries and do not submit to the code sign server--> | ||
<Copy SourceFiles="@(InstallersToSign)" DestinationFolder="signed" Condition="$(DelaySign)" /> | ||
<SetEnvVar EnvName="SignedMsiDir" EnvValue="$(SignedOutputRootDir)" /> | ||
</Target> | ||
|
||
<Message Text="----> Dlls signing section" Importance="high"/> | ||
<!-- Azure --> | ||
<ItemGroup Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore'"> | ||
<DelaySignedAssembliesToSign Include="$(PackageDirectory)\$(Configuration)\**\Microsoft*Azure*PowerShell*Cmdlets*.dll" /> | ||
</ItemGroup> | ||
|
||
<Message Importance="high" Text="$(PackageDirectory)\$(Configuration) does not contains any files to sign. Code sign will skip." Condition="'@(DelaySignedAssembliesToSign)' == ''" /> | ||
<ESRPSignTask | ||
CopyBackSignedFilesToOriginalLocation="true" | ||
UnsignedFileList="@(DelaySignedAssembliesToSign)" | ||
SignLogDirPath="$(LibraryRoot)dlls-signing.log" | ||
Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/> | ||
|
||
<Exec Command="$(PowerShellCommandPrefix) ". $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) "" /> | ||
|
||
<!-- Copying shortcut to be signed --> | ||
<Copy SourceFiles="$(LibraryRoot)tools\Az\Az.psm1" DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'Netcore'" /> | ||
|
||
<Message Text="----> Scripts signing section" Importance="high"/> | ||
<!-- Azure --> | ||
<ItemGroup Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore'"> | ||
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.ps1" /> | ||
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.psm1" /> | ||
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.ps1xml" /> | ||
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.js" /> | ||
</ItemGroup> | ||
|
||
<ESRPSignTask | ||
CopyBackSignedFilesToOriginalLocation="true" | ||
UnsignedFileList="@(ScriptsToSign)" | ||
SignLogDirPath="$(LibraryRoot)scripts-signing.log" | ||
Condition="!$(DelaySign) and '@(ScriptsToSign)' != ''"/> | ||
|
||
<!-- RemoveCodeSignArtifacts.ps1 --> | ||
<Message Text="----> Remove artifacts section" Importance="high"/> | ||
<Exec Command="$(PowerShellCoreCommandPrefix) "Get-ChildItem -Path $(PackageDirectory) -Recurse -Include 'Signed','Unsigned' | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction Ignore"" | ||
ContinueOnError="WarnAndContinue" | ||
IgnoreExitCode="true" /> | ||
|
||
<!-- CheckSignature.ps1 --> | ||
<Message Text="----> CheckSignature section" Importance="high"/> | ||
<Exec Command="$(PowerShellCommandPrefix) ". $(LibraryToolsFolder)\CheckSignature.ps1 -CustomPath $(PackageDirectory)\$(Configuration) "" Condition="'$(Scope)' != 'Stack'" ContinueOnError="ErrorAndContinue" /> | ||
|
||
<!-- Copy files back after signing --> | ||
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psm1" DestinationFolder="$(LibraryRoot)tools\Az" Condition="'$(Scope)' == 'Netcore'" /> | ||
</Target> | ||
|
||
<Target Name="CodeSignInstaller"> | ||
<Message Text="----> CodeSignInstaller section" Importance="high"/> | ||
<PropertyGroup> | ||
<!--public token associated with MSSharedLibKey.snk--> | ||
<StrongNameToken Condition=" '$(StrongNameToken)' == '' ">31bf3856ad364e35</StrongNameToken> | ||
</PropertyGroup> | ||
<GetFrameworkSdkPath> | ||
<Output TaskParameter="Path" PropertyName="WindowsSdkPath"/> | ||
</GetFrameworkSdkPath> | ||
|
||
<ItemGroup> | ||
<InstallersToSign Include="$(LibraryRoot)\setup\*.msi" /> | ||
</ItemGroup> | ||
|
||
<Message Importance="high" Text="$(LibraryRoot)\setup does not contain any installers to sign. Code sign will skip." | ||
Condition="'@(InstallersToSign)' == ''" /> | ||
|
||
<ESRPSignTask | ||
SignedFilesRootDirPath="$(SignedOutputRootDir)" | ||
UnsignedFileList="@(InstallersToSign)" | ||
SignLogDirPath="$(LibraryRoot)\msi-signing.log" | ||
Condition="!$(DelaySign) and '@(InstallersToSign)' != ''"/> | ||
|
||
<!--If we are testing locally then we copy the binaries and do not submit to the code sign server--> | ||
<Copy SourceFiles="@(InstallersToSign)" DestinationFolder="signed" Condition="$(DelaySign)" /> | ||
<SetEnvVar EnvName="SignedMsiDir" EnvValue="$(SignedOutputRootDir)" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.