Skip to content

Commit 9cd497f

Browse files
author
maddieclayton
committed
add to build
1 parent 0b07cf5 commit 9cd497f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

build.proj

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@
240240
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition= " '$(NetCore)' == 'false' and '$(Stack)' == 'true' "/>
241241
<!-- moved copy tasks -->
242242

243+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. Register-PSRepository -Name MSIcreationrepository -SourceLocation $(PackageDirectory) -InstallationPolicy Trusted &quot; " Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'"/>
244+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryRoot)\setup\generate.ps1 -version 5.0.0 -force -repository MSIcreationrepository &quot; " Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'"/>
245+
<CallTarget Targets="CodeSignInstaller"
246+
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
247+
243248
<Message Importance="high" Text="Running Static Analyser" />
244249
<CallTarget targets="DependencyAnalysis" ContinueOnError="ErrorAndContinue" />
245250
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;" />
@@ -413,6 +418,37 @@
413418
DestinationFolder="$(LibraryRoot)tools\AzureRM.NetCore" Condition= " '$(NetCore)' == 'true' "/>
414419
</Target>
415420

421+
<Target Name="CodeSignInstaller">
422+
<PropertyGroup>
423+
<!--public token associated with MSSharedLibKey.snk-->
424+
<StrongNameToken Condition=" '$(StrongNameToken)' == '' ">31bf3856ad364e35</StrongNameToken>
425+
</PropertyGroup>
426+
<GetFrameworkSdkPath>
427+
<Output TaskParameter="Path" PropertyName="WindowsSdkPath"/>
428+
</GetFrameworkSdkPath>
429+
430+
<ItemGroup>
431+
<InstallersToSign Include="$(LibraryRoot)\setup\*.msi" />
432+
</ItemGroup>
433+
434+
<Message Importance="high" Text="$(LibraryRoot)\setup does not contains any installers to sign. Code sign will skip."
435+
Condition="'@(InstallersToSign)' == ''" />
436+
437+
<CodeSigningTask
438+
Description="Microsoft Azure PowerShell"
439+
Keywords="Microsoft Azure PowerShell"
440+
UnsignedFiles="@(InstallersToSign)"
441+
DestinationPath="$(SignedOutputRootDir)"
442+
SigningLogPath="$(LibraryRoot)\msi-signing.log"
443+
Certificates="402"
444+
ToolsPath="$(CIToolsPath)"
445+
Condition="!$(DelaySign) and '@(InstallersToSign)' != ''"/>
446+
447+
<!--If we are testing locally then we copy the binaries and do not submit to the code sign server-->
448+
<Copy SourceFiles="@(InstallersToSign)" DestinationFolder="signed" Condition="$(DelaySign)" />
449+
<SetEnvVar EnvName="SignedMsiDir" EnvValue="$(SignedOutputRootDir)" />
450+
</Target>
451+
416452
<!-- Run Dependecy Analyzer -->
417453
<Target Name="DependencyAnalysis">
418454
<MSBuild

0 commit comments

Comments
 (0)