Skip to content

Commit 51e918e

Browse files
authored
Merge pull request #7654 from MiYanni/psm1-removal
Removing psm1 placeholder files
2 parents 552215d + f0b10cd commit 51e918e

File tree

10 files changed

+48
-108
lines changed

10 files changed

+48
-108
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ Package
237237
launchSettings.json
238238
/src/StackAdmin/AzureRM/AzureRM.psm1
239239
/src/StackAdmin/AzureStack/AzureStack.psm1
240-
/tools/AzureRM.Netcore/AzureRM.Netcore.psm1
241240
/ModuleMappings.json
242241
/SolutionMappings.json
243242
/TestMappings.json
244243
/tools/Modules/tmp
244+
/tools/Az/Az.psm1

build.proj

Lines changed: 26 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

4-
54
<!--
65
Available Targets:
76
@@ -68,7 +67,7 @@
6867
</PropertyGroup>
6968

7069
<PropertyGroup Condition="$(NetCore) == 'true' ">
71-
<Scope>NetCore</Scope>
70+
<Scope>Netcore</Scope>
7271
</PropertyGroup>
7372

7473
<!-- Set Skips -->
@@ -85,7 +84,6 @@
8584
<SkipDependencyAnalysis>true</SkipDependencyAnalysis>
8685
</PropertyGroup>
8786

88-
8987
<ItemGroup>
9088
<LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" Condition="'$(NetCore)' == 'false'" />
9189
<StackSolution Include="$(LibrarySourceFolder)\StackAdmin\Stack.sln" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
@@ -112,9 +110,9 @@
112110
<![CDATA[System.Environment.SetEnvironmentVariable(EnvName, EnvValue);]]>
113111
</Code>
114112
</Task>
115-
</UsingTask> <!--
116-
CI build related
117-
-->
113+
</UsingTask>
114+
115+
<!-- CI build related -->
118116
<PropertyGroup>
119117
<!--OnPremiseBuildTasks is not a good name, but CI server is using that, will update across soon-->
120118
<CIToolsPath>$(OnPremiseBuildTasks)</CIToolsPath>
@@ -201,11 +199,6 @@
201199
<!-- Restore packages for local build tasks-->
202200
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
203201
ContinueOnError="false" />
204-
<!-- Restore packages for repo tasks tasks-->
205-
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
206-
ContinueOnError="false" />
207-
<Exec Command="$(NuGetCommand) restore %(SetupSln.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
208-
ContinueOnError="false" />
209202
<!--Restore the xunit runner needed to run unit tests-->
210203
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
211204
</Target>
@@ -282,60 +275,12 @@
282275
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot;"
283276
Condition="'$(CodeSign)' == 'false'"/>
284277

285-
<!-- Copying modules to be signed -->
286-
287-
<!-- AzureRM -->
288-
<Copy SourceFiles="$(LibraryToolsFolder)\AzureRM\AzureRM.psd1"
289-
DestinationFolder="$(PackageDirectory)\$(Configuration)"
290-
ContinueOnError="false"
291-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
292-
<Copy SourceFiles="$(LibraryToolsFolder)\AzureRM\AzureRM.psm1"
293-
DestinationFolder="$(PackageDirectory)\$(Configuration)"
294-
ContinueOnError="false"
295-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
296-
297-
<!-- Stack Specific -->
298-
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureRM\AzureRM.psd1"
299-
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
300-
ContinueOnError="false"
301-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
302-
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureRM\AzureRM.psm1"
303-
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
304-
ContinueOnError="false"
305-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
306-
307-
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psd1"
308-
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
309-
ContinueOnError="false"
310-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
311-
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psm1"
312-
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
313-
ContinueOnError="false"
314-
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
315-
316-
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
278+
<CallTarget Targets="CodeSignBinaries" Condition="'$(CodeSign)' == 'true'" />
317279

318280
<Exec ContinueOnError="false"
319281
Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; . $(LibraryToolsFolder)\NewOutputTypeIndex.ps1 -OutputFile $(PackageDirectory)\outputtypes.json -BuildConfig $(Configuration) &quot;"
320282
Condition="('$(Scope)' == 'All' or '$(Scope)' == 'Latest') and $(CodeSign) == 'true'" />
321283

322-
<!-- AzureRM -->
323-
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psd1"
324-
DestinationFolder="$(LibraryToolsFolder)\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
325-
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psm1"
326-
DestinationFolder="$(LibraryToolsFolder)\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
327-
328-
<!-- Stack -->
329-
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureRM.psd1"
330-
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
331-
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureRM.psm1"
332-
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
333-
334-
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureStack.psd1"
335-
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
336-
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureStack.psm1"
337-
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
338-
339284
<Message Importance="high" Text="Running Static Analyser" />
340285
<CallTarget targets="DependencyAnalysis" ContinueOnError="ErrorAndContinue" />
341286
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\CheckAssemblies.ps1 -BuildConfig $(Configuration) &quot;" />
@@ -346,14 +291,15 @@
346291
Condition="('$(Scope)' == 'All' or '$(Scope)' == 'Latest') and $(CodeSign) == 'true'" />
347292
</Target>
348293

349-
350-
351294
<!--
352295
Build .Net Core Cmdlets
353296
Fully self contained
354297
-->
355298
<Target Name="BuildNetCore">
356299
<Message Importance="high" Text="Building Cmdlets..." />
300+
<PropertyGroup>
301+
<Scope>Netcore</Scope>
302+
</PropertyGroup>
357303

358304
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;$ProgressPreference = 'SilentlyContinue';. $(LibraryToolsFolder)\CreateAliasMapping.ps1 &quot;"/>
359305

@@ -404,35 +350,23 @@
404350
<Delete Files="@(ExtraPsdFiles->'%(FullPath)')"/>
405351

406352
<!-- Update module manifests. -->
407-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope Netcore &quot; "
353+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot; "
354+
Condition="'$(CodeSign)' == 'false'"
408355
ContinueOnError="false" />
409356
<!-- Generate the Help -->
410357
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Set-Variable -Name ProgressPreference -Value 'SilentlyContinue';. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;"
411358
Condition="'$(SkipHelp)' == 'false'"
412359
ContinueOnError="false"/>
413360

414-
<!-- Copying modules to be signed -->
415-
<Copy SourceFiles="$(LibraryToolsFolder)\Az\Az.psd1"
416-
DestinationFolder="$(PackageDirectory)\$(Configuration)"
417-
ContinueOnError="false" />
418-
<Copy SourceFiles="$(LibraryToolsFolder)\Az\Az.psm1"
419-
DestinationFolder="$(PackageDirectory)\$(Configuration)"
420-
ContinueOnError="false" />
421-
422-
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
423-
424-
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psd1" DestinationFolder="$(LibraryToolsFolder)\Az" />
425-
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psm1" DestinationFolder="$(LibraryToolsFolder)\Az" />
361+
<CallTarget Targets="CodeSignBinaries" Condition="'$(CodeSign)' == 'true'" />
426362

427363
<!-- Cleanup extraneous files. -->
428364
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;" />
429365
</Target>
430366

431-
432367
<!-- Do everything possible except Publish -->
433368
<Target Name="Full" DependsOnTargets="Clean;Build;Test" />
434369

435-
436370
<Target Name="BuildMsBuildTask" DependsOnTargets="RestoreNugetPackages">
437371
<Message Importance="high" Text="Building RepoTasks" />
438372
<MSBuild Projects="@(LocalBuildTasks)"
@@ -494,20 +428,18 @@
494428
ContinueOnError="false"
495429
Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/>
496430

497-
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot;"
498-
Condition="'$(Scope)' != 'Netcore'"/>
431+
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot;"/>
499432

500433
<!-- Copying shortcut to be signed -->
501434
<Copy SourceFiles="$(LibraryRoot)tools\Az\Az.psm1"
502-
DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Netcore'" />
435+
DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'Netcore'" />
503436
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1"
504437
DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
505438
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureRM\AzureRM.psm1"
506439
DestinationFolder="$(StackPackageFolder)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
507440
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psm1"
508441
DestinationFolder="$(StackPackageFolder)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
509442

510-
511443
<!-- Azure -->
512444
<ItemGroup Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore'">
513445
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.ps1"/>
@@ -542,9 +474,17 @@
542474
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\CheckSignature.ps1 -CustomPath $(StackPackageFolder)\$(Configuration) &quot;"
543475
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'"
544476
ContinueOnError="ErrorAndContinue" />
545-
</Target>
546-
547477

478+
<!-- Copy files back after signing -->
479+
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psm1"
480+
DestinationFolder="$(LibraryRoot)tools\Az" Condition="'$(Scope)' == 'Netcore'" />
481+
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psm1"
482+
DestinationFolder="$(LibraryRoot)tools\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
483+
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureRM.psm1"
484+
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
485+
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureStack.psm1"
486+
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
487+
</Target>
548488

549489
<Target Name="BuildInstaller" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'">
550490
<Exec Command="$(PowerShellCommandPrefix) &quot;. Register-PSRepository -Name MSIcreationrepository -SourceLocation $(PackageDirectory) -InstallationPolicy Trusted &quot; "/>
@@ -553,8 +493,6 @@
553493
<CallTarget Targets="CodeSignInstaller" Condition=" '$(CodeSign)' == 'true'" />
554494
</Target>
555495

556-
557-
558496
<Target Name="CodeSignInstaller">
559497
<PropertyGroup>
560498
<!--public token associated with MSSharedLibKey.snk-->
@@ -586,8 +524,6 @@
586524
<SetEnvVar EnvName="SignedMsiDir" EnvValue="$(SignedOutputRootDir)" />
587525
</Target>
588526

589-
590-
591527
<!-- Run Validation -->
592528
<Target Name="DependencyAnalysis"
593529
Condition="'$(SkipDependencyAnalysis)' == 'false'">
@@ -612,8 +548,7 @@
612548
<OnError ExecuteTargets="StaticAnalysisErrorMessage"/>
613549
</Target>
614550

615-
616-
<Target Name="StaticAnalysisErrorMessage">
551+
<Target Name="StaticAnalysisErrorMessage">
617552
<Error Text="StaticAnalysis has failed. Please follow the instructions on this doc: https://github.com/Azure/azure-powershell/blob/preview/documentation/Debugging-StaticAnalysis-Errors.md"/>
618553
</Target>
619554

@@ -643,7 +578,7 @@
643578
ContinueOnError="false"/>
644579

645580
<CallTarget Targets="BuildInstaller" Condition="'$(Scope)' =='All'" />
646-
</Target>
581+
</Target>
647582

648583
<PropertyGroup>
649584
<RunTestLive Condition="'$(RunTestLive)' == ''">false</RunTestLive>
@@ -703,10 +638,7 @@
703638
DependsOnTargets="Clean;Build;Test;RunOneSDKCIT" />
704639

705640
<!-- Run live tests and record mocks -->
706-
<Target
707-
Name="RunLiveTests"
708-
DependsOnTargets="Clean;Build;LiveTestsFilter" />
709-
641+
<Target Name="RunLiveTests" DependsOnTargets="Clean;Build;LiveTestsFilter" />
710642

711643
<Target Name="LiveTestsFilter" DependsOnTargets="Build;BeforeRunTests">
712644
<Message Importance="high" Text="Running live tests..." />

src/StackAdmin/AzureRM/AzureRM.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# RootModule
12-
RootModule = "AzureRM.psm1"
12+
# RootModule = ''
1313

1414
# Version number of this module.
1515
ModuleVersion = '2.3.0.1'

src/StackAdmin/AzureRM/AzureRM.psm1

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/StackAdmin/AzureStack/AzureStack.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Root Module
12-
RootModule = "AzureStack.psm1"
12+
# RootModule = ''
1313

1414
# Version number of this module.
1515
ModuleVersion = '1.5.1'

src/StackAdmin/AzureStack/AzureStack.psm1

Lines changed: 0 additions & 2 deletions
This file was deleted.

tools/Az/Az.psm1

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/AzureRM/AzureRM.psm1

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/CheckSignature.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function Check-All {
5050
$invalidList = @()
5151

5252
$files = Get-ChildItem $path\* -Include *.dll -Recurse | Where-Object { $_.FullName -like "*Azure*" }
53+
$files = $files | Where-Object { ($_.FullName -notlike "*System.Management.Automation*") }
5354
Write-Host "Checking the strong name signature of $($files.Count) files (.dll)" -ForegroundColor Yellow
5455

5556
$invalidStrongNameList = @()
@@ -76,7 +77,8 @@ function Check-All {
7677
($_.FullName -notlike "*Security.Cryptography*") -and `
7778
($_.FullName -notlike "*NLog*") -and `
7879
($_.FullName -notlike "*YamlDotNet*") -and `
79-
($_.FullName -notlike "*BouncyCastle.Crypto*")}
80+
($_.FullName -notlike "*BouncyCastle.Crypto*") -and `
81+
($_.FullName -notlike "*System.Management.Automation*")}
8082
Write-Host "Checking the authenticode signature of $($files.Count) files (.dll, .ps1, .psm1)" -ForegroundColor Yellow
8183

8284
$invalidAuthenticodeList = @()

tools/UpdateModules.ps1

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ param(
2929
[string] $BuildConfig,
3030

3131
[Parameter(Mandatory = $false, Position = 1)]
32-
[ValidateSet("All", "Latest", "Stack", "NetCore","ServiceManagement","AzureStorage")]
32+
[ValidateSet("All", "Latest", "Stack", "NetCore", "ServiceManagement", "AzureStorage")]
3333
[string] $Scope
3434
)
3535

@@ -309,7 +309,7 @@ function Update-Azure {
309309
if ($scope -in $script:StorageScopes) {
310310
$modulePath = "$script:AzurePackages\$buildConfig\Storage\Azure.Storage"
311311
Write-Host "Updating AzureStorage module from $modulePath"
312-
New-ModulePsm1 -ModulePath $modulePath -TemplatePath $templateLocation -IsRMModule:$false
312+
New-ModulePsm1 -ModulePath $modulePath -TemplatePath $script:TemplateLocation -IsRMModule:$false
313313
Write-Host " "
314314
}
315315

@@ -359,13 +359,23 @@ function Update-Stack {
359359

360360
$modulePath = "$script:StackPackages\$buildConfig\Storage\Azure.Storage"
361361
Write-Host "Updating AzureStorage module from $modulePath"
362-
New-ModulePsm1 -ModulePath $modulePath -TemplatePath $templateLocation -IsRMModule:$false
362+
New-ModulePsm1 -ModulePath $modulePath -TemplatePath $script:TemplateLocation -IsRMModule:$false
363363
Write-Host " "
364364

365365
$StackRMModules = Get-ChildItem -Path $script:StackRMRoot -Directory
366366
Write-Host "Updating stack modules"
367367
Update-RMModule -Modules $StackRMModules
368368
Write-Host " "
369+
370+
$modulePath = "$script:StackProjects\AzureRM"
371+
Write-Host "Updating AzureRM module from $modulePath"
372+
New-ModulePsm1 -ModulePath $modulePath -TemplatePath $script:TemplateLocation
373+
Write-Host " "
374+
375+
$modulePath = "$script:StackProjects\AzureStack"
376+
Write-Host "Updating AzureStack module from $modulePath"
377+
New-ModulePsm1 -ModulePath $modulePath -TemplatePath $script:TemplateLocation
378+
Write-Host " "
369379
}
370380

371381
<#
@@ -423,8 +433,9 @@ $script:StorageScopes = @('All', 'Latest', 'AzureStorage')
423433
$script:ServiceScopes = @('All', 'Latest', 'ServiceManagement')
424434

425435
# Package locations
426-
$script:AzurePackages = "$PSSCriptRoot\..\src\Package"
427-
$script:StackPackages = "$PSSCriptRoot\..\src\Stack"
436+
$script:AzurePackages = "$PSScriptRoot\..\src\Package"
437+
$script:StackPackages = "$PSScriptRoot\..\src\Stack"
438+
$script:StackProjects = "$PSScriptRoot\..\src\StackAdmin"
428439

429440
# Resource Management folders
430441
$script:AzureRMRoot = "$script:AzurePackages\$buildConfig\ResourceManager\AzureResourceManager"

0 commit comments

Comments
 (0)