Skip to content

Commit

Permalink
Merge pull request Azure#7654 from MiYanni/psm1-removal
Browse files Browse the repository at this point in the history
Removing psm1 placeholder files
  • Loading branch information
markcowl authored Oct 30, 2018
2 parents 552215d + f0b10cd commit 51e918e
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ Package
launchSettings.json
/src/StackAdmin/AzureRM/AzureRM.psm1
/src/StackAdmin/AzureStack/AzureStack.psm1
/tools/AzureRM.Netcore/AzureRM.Netcore.psm1
/ModuleMappings.json
/SolutionMappings.json
/TestMappings.json
/tools/Modules/tmp
/tools/Az/Az.psm1
120 changes: 26 additions & 94 deletions build.proj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">


<!--
Available Targets:
Expand Down Expand Up @@ -68,7 +67,7 @@
</PropertyGroup>

<PropertyGroup Condition="$(NetCore) == 'true' ">
<Scope>NetCore</Scope>
<Scope>Netcore</Scope>
</PropertyGroup>

<!-- Set Skips -->
Expand All @@ -85,7 +84,6 @@
<SkipDependencyAnalysis>true</SkipDependencyAnalysis>
</PropertyGroup>


<ItemGroup>
<LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" Condition="'$(NetCore)' == 'false'" />
<StackSolution Include="$(LibrarySourceFolder)\StackAdmin\Stack.sln" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
Expand All @@ -112,9 +110,9 @@
<![CDATA[System.Environment.SetEnvironmentVariable(EnvName, EnvValue);]]>
</Code>
</Task>
</UsingTask> <!--
CI build related
-->
</UsingTask>

<!-- CI build related -->
<PropertyGroup>
<!--OnPremiseBuildTasks is not a good name, but CI server is using that, will update across soon-->
<CIToolsPath>$(OnPremiseBuildTasks)</CIToolsPath>
Expand Down Expand Up @@ -201,11 +199,6 @@
<!-- Restore packages for local build tasks-->
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
ContinueOnError="false" />
<!-- Restore packages for repo tasks tasks-->
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
ContinueOnError="false" />
<Exec Command="$(NuGetCommand) restore %(SetupSln.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
ContinueOnError="false" />
<!--Restore the xunit runner needed to run unit tests-->
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
</Target>
Expand Down Expand Up @@ -282,60 +275,12 @@
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope) &quot;"
Condition="'$(CodeSign)' == 'false'"/>

<!-- Copying modules to be signed -->

<!-- AzureRM -->
<Copy SourceFiles="$(LibraryToolsFolder)\AzureRM\AzureRM.psd1"
DestinationFolder="$(PackageDirectory)\$(Configuration)"
ContinueOnError="false"
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
<Copy SourceFiles="$(LibraryToolsFolder)\AzureRM\AzureRM.psm1"
DestinationFolder="$(PackageDirectory)\$(Configuration)"
ContinueOnError="false"
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />

<!-- Stack Specific -->
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureRM\AzureRM.psd1"
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
ContinueOnError="false"
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureRM\AzureRM.psm1"
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
ContinueOnError="false"
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />

<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psd1"
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
ContinueOnError="false"
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psm1"
DestinationFolder="$(StackPackageFolder)\$(Configuration)"
ContinueOnError="false"
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />

<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
<CallTarget Targets="CodeSignBinaries" Condition="'$(CodeSign)' == 'true'" />

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

<!-- AzureRM -->
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psd1"
DestinationFolder="$(LibraryToolsFolder)\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psm1"
DestinationFolder="$(LibraryToolsFolder)\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />

<!-- Stack -->
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureRM.psd1"
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureRM.psm1"
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />

<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureStack.psd1"
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureStack.psm1"
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />

<Message Importance="high" Text="Running Static Analyser" />
<CallTarget targets="DependencyAnalysis" ContinueOnError="ErrorAndContinue" />
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\CheckAssemblies.ps1 -BuildConfig $(Configuration) &quot;" />
Expand All @@ -346,14 +291,15 @@
Condition="('$(Scope)' == 'All' or '$(Scope)' == 'Latest') and $(CodeSign) == 'true'" />
</Target>



<!--
Build .Net Core Cmdlets
Fully self contained
-->
<Target Name="BuildNetCore">
<Message Importance="high" Text="Building Cmdlets..." />
<PropertyGroup>
<Scope>Netcore</Scope>
</PropertyGroup>

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

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

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

<!-- Copying modules to be signed -->
<Copy SourceFiles="$(LibraryToolsFolder)\Az\Az.psd1"
DestinationFolder="$(PackageDirectory)\$(Configuration)"
ContinueOnError="false" />
<Copy SourceFiles="$(LibraryToolsFolder)\Az\Az.psm1"
DestinationFolder="$(PackageDirectory)\$(Configuration)"
ContinueOnError="false" />

<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />

<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psd1" DestinationFolder="$(LibraryToolsFolder)\Az" />
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psm1" DestinationFolder="$(LibraryToolsFolder)\Az" />
<CallTarget Targets="CodeSignBinaries" Condition="'$(CodeSign)' == 'true'" />

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


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


<Target Name="BuildMsBuildTask" DependsOnTargets="RestoreNugetPackages">
<Message Importance="high" Text="Building RepoTasks" />
<MSBuild Projects="@(LocalBuildTasks)"
Expand Down Expand Up @@ -494,20 +428,18 @@
ContinueOnError="false"
Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/>

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

<!-- Copying shortcut to be signed -->
<Copy SourceFiles="$(LibraryRoot)tools\Az\Az.psm1"
DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Netcore'" />
DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'Netcore'" />
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psm1"
DestinationFolder="$(PackageDirectory)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureRM\AzureRM.psm1"
DestinationFolder="$(StackPackageFolder)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
<Copy SourceFiles="$(LibrarySourceFolder)\StackAdmin\AzureStack\AzureStack.psm1"
DestinationFolder="$(StackPackageFolder)\$(Configuration)" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />


<!-- Azure -->
<ItemGroup Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest' or '$(Scope)' == 'Netcore'">
<ScriptsToSign Include="$(PackageDirectory)\$(Configuration)\**\*.ps1"/>
Expand Down Expand Up @@ -542,9 +474,17 @@
<Exec Command="$(PowerShellCommandPrefix) &quot;. $(LibraryToolsFolder)\CheckSignature.ps1 -CustomPath $(StackPackageFolder)\$(Configuration) &quot;"
Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'"
ContinueOnError="ErrorAndContinue" />
</Target>


<!-- Copy files back after signing -->
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\Az.psm1"
DestinationFolder="$(LibraryRoot)tools\Az" Condition="'$(Scope)' == 'Netcore'" />
<Copy SourceFiles="$(PackageDirectory)\$(Configuration)\AzureRM.psm1"
DestinationFolder="$(LibraryRoot)tools\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Latest'" />
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureRM.psm1"
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureRM" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
<Copy SourceFiles="$(StackPackageFolder)\$(Configuration)\AzureStack.psm1"
DestinationFolder="$(LibrarySourceFolder)\StackAdmin\AzureStack" Condition="'$(Scope)' == 'All' or '$(Scope)' == 'Stack'" />
</Target>

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



<Target Name="CodeSignInstaller">
<PropertyGroup>
<!--public token associated with MSSharedLibKey.snk-->
Expand Down Expand Up @@ -586,8 +524,6 @@
<SetEnvVar EnvName="SignedMsiDir" EnvValue="$(SignedOutputRootDir)" />
</Target>



<!-- Run Validation -->
<Target Name="DependencyAnalysis"
Condition="'$(SkipDependencyAnalysis)' == 'false'">
Expand All @@ -612,8 +548,7 @@
<OnError ExecuteTargets="StaticAnalysisErrorMessage"/>
</Target>


<Target Name="StaticAnalysisErrorMessage">
<Target Name="StaticAnalysisErrorMessage">
<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"/>
</Target>

Expand Down Expand Up @@ -643,7 +578,7 @@
ContinueOnError="false"/>

<CallTarget Targets="BuildInstaller" Condition="'$(Scope)' =='All'" />
</Target>
</Target>

<PropertyGroup>
<RunTestLive Condition="'$(RunTestLive)' == ''">false</RunTestLive>
Expand Down Expand Up @@ -703,10 +638,7 @@
DependsOnTargets="Clean;Build;Test;RunOneSDKCIT" />

<!-- Run live tests and record mocks -->
<Target
Name="RunLiveTests"
DependsOnTargets="Clean;Build;LiveTestsFilter" />

<Target Name="RunLiveTests" DependsOnTargets="Clean;Build;LiveTestsFilter" />

<Target Name="LiveTestsFilter" DependsOnTargets="Build;BeforeRunTests">
<Message Importance="high" Text="Running live tests..." />
Expand Down
2 changes: 1 addition & 1 deletion src/StackAdmin/AzureRM/AzureRM.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@{

# RootModule
RootModule = "AzureRM.psm1"
# RootModule = ''

# Version number of this module.
ModuleVersion = '2.3.0.1'
Expand Down
1 change: 0 additions & 1 deletion src/StackAdmin/AzureRM/AzureRM.psm1

This file was deleted.

2 changes: 1 addition & 1 deletion src/StackAdmin/AzureStack/AzureStack.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@{

# Root Module
RootModule = "AzureStack.psm1"
# RootModule = ''

# Version number of this module.
ModuleVersion = '1.5.1'
Expand Down
2 changes: 0 additions & 2 deletions src/StackAdmin/AzureStack/AzureStack.psm1

This file was deleted.

1 change: 0 additions & 1 deletion tools/Az/Az.psm1

This file was deleted.

1 change: 0 additions & 1 deletion tools/AzureRM/AzureRM.psm1

This file was deleted.

4 changes: 3 additions & 1 deletion tools/CheckSignature.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function Check-All {
$invalidList = @()

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

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

$invalidAuthenticodeList = @()
Expand Down
21 changes: 16 additions & 5 deletions tools/UpdateModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ param(
[string] $BuildConfig,

[Parameter(Mandatory = $false, Position = 1)]
[ValidateSet("All", "Latest", "Stack", "NetCore","ServiceManagement","AzureStorage")]
[ValidateSet("All", "Latest", "Stack", "NetCore", "ServiceManagement", "AzureStorage")]
[string] $Scope
)

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

Expand Down Expand Up @@ -359,13 +359,23 @@ function Update-Stack {

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

$StackRMModules = Get-ChildItem -Path $script:StackRMRoot -Directory
Write-Host "Updating stack modules"
Update-RMModule -Modules $StackRMModules
Write-Host " "

$modulePath = "$script:StackProjects\AzureRM"
Write-Host "Updating AzureRM module from $modulePath"
New-ModulePsm1 -ModulePath $modulePath -TemplatePath $script:TemplateLocation
Write-Host " "

$modulePath = "$script:StackProjects\AzureStack"
Write-Host "Updating AzureStack module from $modulePath"
New-ModulePsm1 -ModulePath $modulePath -TemplatePath $script:TemplateLocation
Write-Host " "
}

<#
Expand Down Expand Up @@ -423,8 +433,9 @@ $script:StorageScopes = @('All', 'Latest', 'AzureStorage')
$script:ServiceScopes = @('All', 'Latest', 'ServiceManagement')

# Package locations
$script:AzurePackages = "$PSSCriptRoot\..\src\Package"
$script:StackPackages = "$PSSCriptRoot\..\src\Stack"
$script:AzurePackages = "$PSScriptRoot\..\src\Package"
$script:StackPackages = "$PSScriptRoot\..\src\Stack"
$script:StackProjects = "$PSScriptRoot\..\src\StackAdmin"

# Resource Management folders
$script:AzureRMRoot = "$script:AzurePackages\$buildConfig\ResourceManager\AzureResourceManager"
Expand Down

0 comments on commit 51e918e

Please sign in to comment.