Skip to content

Commit ab96276

Browse files
author
maddieclayton
committed
merge upstream
2 parents 6d2f823 + 854173b commit ab96276

File tree

241 files changed

+18558
-15248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+18558
-15248
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ FakesAssemblies/
215215
*.GhostDoc.xml
216216
pingme.txt
217217
groupMapping*.json
218+
219+
*.msi
220+
*.wixpdb
221+
218222
.vscode/
219223
/tools/AutomationTestFramework/RunBooks
220224
/tools/AutomationTestFramework/TestHelpers/TestHelpers.zip

AzurePowershell.Test.targets

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@
8181
DiagnosticMessages="false"
8282
ContinueOnError="false"
8383
Condition=" @(XUnitTests) != '' "/>
84-
85-
<CallTarget Targets="TestSetup" />
8684
</Target>
8785

8886
<Target Name="InvokeXUnitAll" DependsOnTargets="DeclareXunitTests">
@@ -101,8 +99,6 @@
10199
DiagnosticMessages="false"
102100
ContinueOnError="false"
103101
Condition=" @(XUnitTests) != '' "/>
104-
105-
<CallTarget Targets="TestSetup" />
106102
</Target>
107103

108104
<Target Name="TimeoutErrorHandler">
@@ -112,54 +108,6 @@
112108
<Target Name="BeforeRunTests">
113109
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
114110
</Target>
115-
116-
<Target Name="TestSetup">
117-
<Message Importance="high" Text="Setup XUnit tests" />
118-
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
119-
120-
<Message Text="Copying test assets" />
121-
<!-- We copy this file right after we build setup test for signing, so now copying the signed copy back where it is needed for the test -->
122-
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\PowerShellSetup.Test.dll"
123-
DestinationFolder="$(LibraryRoot)\setup\PowerShellSetup.Test\bin\$(Configuration)" Condition="Exists('$(PackageDirectory)\$(Configuration)\PowerShellSetup.Test.dll')" />
124-
125-
<Copy SourceFiles="$(SignedOutputRootDir)\AzurePowerShell.msi"
126-
DestinationFolder="$(LibraryRoot)\setup\PowerShellSetup.Test\bin\$(Configuration)" Condition="Exists('$(SignedOutputRootDir)\AzurePowerShell.msi')" />
127-
128-
<ItemGroup Condition=" '$(scope)' == 'all' AND '$(CodeSign)' != 'true' ">
129-
<SetupDebugTests Include=".\setup\PowerShellSetup.Test\bin\Debug\PowerShellSetup.Test.dll" />
130-
</ItemGroup>
131-
132-
<ItemGroup Condition=" '$(Configuration)' == 'Release' AND '$(scope)' == 'all' AND '$(CodeSign)' == 'true' ">
133-
<!-- We want to run setup tests related to signing that can only be run on signed bits -->
134-
<SetupReleaseTests Include=".\setup\PowerShellSetup.Test\bin\Release\PowerShellSetup.Test.dll" />
135-
</ItemGroup>
136-
<xunit
137-
Assemblies="@(SetupDebugTests)"
138-
AppDomains="true"
139-
ShadowCopy="false"
140-
ParallelizeTestCollections="false"
141-
ParallelizeAssemblies="true"
142-
IncludeTraits="AcceptanceType=CheckIn"
143-
ExcludeTraits="SignedBuild=BVT"
144-
Html="$(TestOutputDirectory)\AzPsSetupTest.html"
145-
MaxParallelThreads="10"
146-
DiagnosticMessages="false"
147-
ContinueOnError="false"
148-
Condition=" '$(scope)' == 'all' "/>
149-
150-
<xunit
151-
Assemblies="@(SetupReleaseTests)"
152-
AppDomains="true"
153-
ShadowCopy="false"
154-
ParallelizeTestCollections="false"
155-
ParallelizeAssemblies="true"
156-
IncludeTraits="SignedBuild=BVT"
157-
Html="$(TestOutputDirectory)\AzPsSetupTestSigned.html"
158-
MaxParallelThreads="10"
159-
DiagnosticMessages="false"
160-
ContinueOnError="false"
161-
Condition=" '$(Configuration)' == 'Release' AND '$(scope)' == 'all' AND '$(CodeSign)' == 'true' "/>
162-
</Target>
163111

164112
<Target Name="TestManagement">
165113
<Xunit.Runner.MSBuild.xunit Assemblies="$(ManagementTestDebug)" Html="$(TestOutputDirectory)\ManagementDebug.xunit.dll.html" Verbose="false"

build.proj

Lines changed: 20 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
1313
/t:Test
1414
Runs tests
15+
16+
/t:Publish
17+
Creates local nuget packages and MSI
1518
1619
/p:CodeSign=True
1720
Code sign binaries, mainly for official release. Default is false.
1821
1922
/p:CodeSign=True;DelaySign=True
20-
Test the code sign workflow locally.
23+
Test the code sign workflow locally.
2124
2225
/p:Scope
2326
'ServiceManagement': service management
@@ -26,7 +29,7 @@
2629
By default, it builds all
2730
2831
/p:SkipHelp=True
29-
Skips help generation and installer creation, mainly for local builds to save time.
32+
Skips help generation, mainly for local builds to save time.
3033
-->
3134

3235
<!-- Define build properties -->
@@ -42,7 +45,6 @@
4245
<DelaySign Condition =" '$(DelaySign)' == '' ">false</DelaySign>
4346
<SignedOutputRootDir>$(LibraryRoot)signed</SignedOutputRootDir>
4447
<BuildOutputDirectory>$(PublishDirectory)\Build</BuildOutputDirectory>
45-
<SetupOutputDirectory>$(PublishDirectory)\Setup</SetupOutputDirectory>
4648
<TestOutputDirectory>$(PublishDirectory)\TestResults</TestOutputDirectory>
4749
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
4850
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' == '' ">http://psget/PSGallery/api/v2/</NuGetPublishingSource>
@@ -67,7 +69,6 @@
6769
<CmdletSolutionsToBuild Include=".\src\Stack.sln"
6870
Condition=" '$(Stack)' == 'true' "/>
6971

70-
<SetupSln Include=".\setup\azurepowershell.sln" />
7172
<StaticAnalysis Include=".\tools\StaticAnalysis\StaticAnalysis.sln" />
7273
<LocalBuildTasks Include="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.sln" />
7374
</ItemGroup>
@@ -181,8 +182,6 @@
181182
<!-- Restore packages for local build tasks-->
182183
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetLocalBuildTaskPackages)"
183184
ContinueOnError="false" />
184-
<Exec Command="$(NuGetCommand) restore %(SetupSln.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
185-
ContinueOnError="false" />
186185

187186
<!--Restore the xunit runner needed to run unit tests-->
188187
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
@@ -208,7 +207,6 @@
208207
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;$ProgressPreference = 'SilentlyContinue';. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;"
209208
ContinueOnError="false"
210209
Condition=" '$(SkipHelp)' == 'false' and '$(Latest)' == 'true'"/>
211-
<CallTarget Targets="BuildSetupTest"/>
212210
<!-- moved copy tasks -->
213211

214212
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) $(Scope) -Profile Latest &quot; " Condition="'$(Latest)' == 'true' and '$(CodeSign)' == 'false'"/>
@@ -228,13 +226,6 @@
228226
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psm1"
229227
DestinationFolder="$(LibrarySourceFolder)\Stack\$(Configuration)" Condition= " '$(NetCore)' == 'false' and '$(Stack)' == 'true' and '$(CodeSign)' == 'false'"/>
230228

231-
<Copy SourceFiles="$(LibraryRoot)setup\Setup\RemoveGalleryModules.ps1"
232-
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)"
233-
Condition=" '$(CodeSign)' == 'true' "/>
234-
<Copy SourceFiles="$(LibraryRoot)setup\Setup\SetExecutionPolicy.ps1"
235-
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)"
236-
Condition=" '$(CodeSign)' == 'true' "/>
237-
238229
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
239230

240231

@@ -252,9 +243,6 @@
252243
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition= " '$(NetCore)' == 'false' and '$(Stack)' == 'true' "/>
253244
<!-- moved copy tasks -->
254245

255-
<CallTarget Targets="BuildSetup" Condition=" '$(SkipHelp)' == 'false' "/>
256-
<CallTarget Targets="CodeSignInstaller"
257-
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
258246
<Message Importance="high" Text="Running Static Analyser" />
259247
<CallTarget targets="DependencyAnalysis" ContinueOnError="ErrorAndContinue" />
260248
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;" />
@@ -266,8 +254,6 @@
266254

267255
<!-- Build and create package content -->
268256
<Exec Command="dotnet --version"/>
269-
<Exec Command="dotnet restore Azure.PowerShell.Netcore.sln"/>
270-
<Exec Command="dotnet build Azure.PowerShell.Netcore.sln -c $(Configuration)"/>
271257
<Exec Command="dotnet publish Azure.PowerShell.Netcore.sln -c $(Configuration)"/>
272258

273259
<!-- Delete powershell runtime files -->
@@ -312,9 +298,9 @@
312298
<Delete Files="@(ExtraPsdFiles->'%(FullPath)')"/>
313299

314300
<!-- Update module manifests. -->
315-
<Exec Command="&quot;$(PowerShellCoreCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) AzureRM.Netcore -Profile Latest &quot; " Condition="'$(Latest)' == 'true' and '$(CodeSign)' == 'false'"/>
301+
<Exec Command="&quot;$(PowerShellCoreCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) AzureRM.Netcore -Profile Latest &quot; " Condition="'$(Latest)' == 'true' and '$(CodeSign)' == 'false'" ContinueOnError="false" />
316302

317-
<!-- Generate the help. -->
303+
<!-- Generate the help. -->
318304
<Exec Command="&quot;$(PowerShellCoreCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;Set-Variable -Name ProgressPreference -Value 'SilentlyContinue';. $(LibraryToolsFolder)\GenerateHelp.ps1 -GenerateMamlHelp -BuildConfig $(Configuration) &quot;" ContinueOnError="true" Condition=" '$(SkipHelp)' == 'false' and '$(Latest)' == 'true'"/>
319305

320306
<!-- Cleanup extraneous files. -->
@@ -327,32 +313,6 @@
327313
<Target
328314
Name="Full"
329315
DependsOnTargets="Clean;Build;Test" />
330-
331-
<Target Name="BuildSetupTest" Condition=" '$(Scope)' == 'all' ">
332-
<MSBuild
333-
Projects=".\setup\PowerShellSetup.Test\PowerShellSetup.Test.csproj"
334-
Targets="Build"
335-
Properties="Configuration=$(Configuration);Platform=AnyCPU"
336-
ContinueOnError="false"
337-
Condition=" '$(Scope)' == 'all' "/>
338-
339-
<Copy SourceFiles="$(LibraryRoot)\setup\PowerShellSetup.Test\bin\$(Configuration)\PowerShellSetup.Test.dll"
340-
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" Condition="Exists('$(LibraryRoot)\setup\PowerShellSetup.Test\bin\$(Configuration)\PowerShellSetup.Test.dll')" />
341-
</Target>
342-
343-
<Target Name="BuildSetup" Condition=" '$(Scope)' == 'all' ">
344-
<!-- Copying shortcut to be signed -->
345-
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\RemoveGalleryModules.ps1;$(LibrarySourceFolder)\Package\$(Configuration)\SetExecutionPolicy.ps1"
346-
DestinationFolder="$(LibraryRoot)setup\Setup\"
347-
Condition=" '$(CodeSign)' == 'true' "/>
348-
349-
<MSBuild
350-
Projects="@(SetupSln)"
351-
Targets="Build"
352-
Properties="Configuration=$(Configuration);Platform=Any CPU"
353-
ContinueOnError="false"
354-
Condition=" '$(Scope)' == 'all' "/>
355-
</Target>
356316

357317
<Target Name="BuildMsBuildTask" DependsOnTargets="RestoreNugetPackages">
358318
<MSBuild Projects="@(LocalBuildTasks)"
@@ -376,7 +336,6 @@
376336
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" Condition="'$(Latest)' == 'true' " />
377337
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" Condition="'$(Latest)' == 'true' " />
378338
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Management.Sql.Legacy.dll" Condition="'$(Latest)' == 'true' " />
379-
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\PowerShellSetup.Test.dll" Condition= " '$(Latest)' == 'true' and '$(NetCore)' == 'false' "/>
380339

381340
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Stack\$(Configuration)\**\Microsoft*Azure*Commands*.dll" Condition="'$(Stack)' == 'true' " />
382341
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Stack\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" Condition="'$(Stack)' == 'true' " />
@@ -429,13 +388,11 @@
429388
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.psm1" Condition="'$(Latest)' == 'true' " />
430389
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1xml" Condition="'$(Latest)' == 'true' " />
431390
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.js" Condition="'$(Latest)' == 'true' " />
432-
<ScriptsToSign Include="$(LibraryRoot)setup\Setup\*.ps1" Condition="'$(Latest)' == 'true' "/>
433391

434392
<ScriptsToSign Include="$(LibrarySourceFolder)\Stack\$(Configuration)\**\*.ps1" Condition="'$(Stack)' == 'true' "/>
435393
<ScriptsToSign Include="$(LibrarySourceFolder)\Stack\$(Configuration)\**\*.psm1" Condition="'$(Stack)' == 'true' " />
436394
<ScriptsToSign Include="$(LibrarySourceFolder)\Stack\$(Configuration)\**\*.ps1xml" Condition="'$(Stack)' == 'true' " />
437395
<ScriptsToSign Include="$(LibrarySourceFolder)\Stack\$(Configuration)\**\*.js" Condition="'$(Stack)' == 'true' " />
438-
<!-- <ScriptsToSign Include="$(LibraryRoot)stacksetup\Setup\*.ps1" Condition="'$(Stack)' == 'true' " /> -->
439396
</ItemGroup>
440397

441398
<CodeSigningTask
@@ -449,16 +406,6 @@
449406
ToolsPath="$(CIToolsPath)"
450407
Condition="!$(DelaySign) and '@(ScriptsToSign)' != ''"/>
451408

452-
<!-- We cannot verify .js files using Get-AuthenticodeSignature -->
453-
<VerifyAuthenticodeSignatureTask ProbingDirectory="$(PackageDirectory)\$(Configuration)"
454-
FileFilterPattern="microsoft.*.dll;system.*.dll;*.ps1;*.psm1;*.ps1xml;PowerShellSetup.Test.dll" Condition="'$(Latest)' == 'true'">
455-
<Output TaskParameter="AuthCodeSignTaskErrorsDetected" PropertyName="AuthTaskFailed" />
456-
</VerifyAuthenticodeSignatureTask>
457-
<VerifyAuthenticodeSignatureTask ProbingDirectory="$(LibrarySourceFolder)\Stack\$(Configuration)"
458-
FileFilterPattern="microsoft.*.dll;system.*.dll;*.ps1;*.psm1;*.ps1xml;PowerShellSetup.Test.dll" Condition="'$(Latest)' == 'true'">
459-
<Output TaskParameter="AuthCodeSignTaskErrorsDetected" PropertyName="AuthTaskFailed" />
460-
</VerifyAuthenticodeSignatureTask>
461-
462409
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CheckSignature.ps1 -CustomPath $(LibrarySourceFolder)\Package\$(Configuration) &quot;"
463410
ContinueOnError="ErrorAndContinue" />
464411

@@ -467,6 +414,14 @@
467414
DestinationFolder="$(LibraryRoot)tools\AzureRM.NetCore" Condition= " '$(NetCore)' == 'true' "/>
468415
</Target>
469416

417+
<Target Name="BuildInstaller">
418+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. Register-PSRepository -Name MSIcreationrepository -SourceLocation $(PackageDirectory) -InstallationPolicy Trusted &quot; " Condition=" '$(Scope)' == 'all'"/>
419+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryRoot)\setup\generate.ps1 -repository MSIcreationrepository &quot; " Condition=" '$(Scope)' == 'all'"/>
420+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. Unregister-PSRepository -Name MSIcreationrepository &quot; " Condition=" '$(Scope)' == 'all'"/>
421+
<CallTarget Targets="CodeSignInstaller"
422+
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
423+
</Target>
424+
470425
<Target Name="CodeSignInstaller">
471426
<PropertyGroup>
472427
<!--public token associated with MSSharedLibKey.snk-->
@@ -477,7 +432,7 @@
477432
</GetFrameworkSdkPath>
478433

479434
<ItemGroup>
480-
<InstallersToSign Include="$(LibraryRoot)\setup*\build\**\*.msi" />
435+
<InstallersToSign Include="$(LibraryRoot)\setup\*.msi" />
481436
</ItemGroup>
482437

483438
<Message Importance="high" Text="$(LibraryRoot)\setup does not contains any installers to sign. Code sign will skip."
@@ -523,7 +478,9 @@
523478
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(NetCore) $(Configuration) $(Scope) $(NuGetKey) \&quot;$(NuGetPublishingSource)\&quot; -Profile Latest &quot; $(NuGetCommand)" Condition="'$(Latest)' == 'true' "/>
524479
<Message Importance="high" Text="Publishing Cmdlets using Stack profile" Condition="'$(Stack)' == 'true' "/>
525480
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\PublishModules.ps1 $(NetCore) $(Configuration) $(Scope) $(NuGetKey) \&quot;$(StackPublishingSource)\&quot; -Profile Stack &quot; $(NuGetCommand)" Condition="'$(Stack)' == 'true' " />
526-
</Target>
481+
482+
<CallTarget Targets="BuildInstaller" />
483+
</Target>
527484

528485
<PropertyGroup>
529486
<RunTestLive Condition="'$(RunTestLive)' == ''">false</RunTestLive>
@@ -556,4 +513,4 @@
556513
<Message Importance="high" Text="Running live tests..." />
557514
<CallTarget Targets="LiveTests"/>
558515
</Target>
559-
</Project>
516+
</Project>

documentation/development-docs/azure-powershell-developer-guide.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,15 @@ The `Commands.ScenarioTests.Common` project can be found in `src/ResourceManager
215215
The following is a list of additional common code projects that can be used:
216216

217217
- `Commands.Common.Authorization`
218-
- Found in `src/ResourceManager/Common/Commands.Common.Authorization`
218+
- Found in `src/Common/Commands.Common.Authorization`
219+
- `Commands.Common.Compute`
220+
- Found in `src/Common/Commands.Common.Compute`
219221
- `Commands.Common.Graph.RBAC`
220-
- Found in `src/ResourceManager/Common/Commands.Common.Graph.RBAC`
222+
- Found in `src/Common/Commands.Common.Graph.RBAC`
221223
- `Commands.Common.Network`
222-
- Found in `src/ResourceManager/Common/Commands.Common.Network`
224+
- Found in `src/Common/Commands.Common.Network`
223225
- `Commands.Common.Storage`
224-
- Found in `src/ResourceManager/Common/Commands.Common.Storage`
226+
- Found in `src/Common/Commands.Common.Storage`
225227

226228
# Creating Cmdlets
227229

-160 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)