Skip to content

Make alias mapping more simple #7320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@
<!-- Investigate why the ChangeLogCheck target removes the 8080th character -->
<!-- <CallTarget targets="ChangeLogCheck" ContinueOnError="false" /> -->

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

<MakeDir Directories="$(PackageDirectory)"
Condition="'$(Scope)' != 'Stack'" />
<MakeDir Directories="$(StackPackageFolder)"
Expand Down
9 changes: 0 additions & 9 deletions documentation/development-docs/create-alias-mappings.md

This file was deleted.

2,399 changes: 17 additions & 2,382 deletions src/ResourceManager/Profile/Commands.Profile/AzureRmAlias/Mappings.cs

Large diffs are not rendered by default.

2,399 changes: 2,399 additions & 0 deletions src/ResourceManager/Profile/Commands.Profile/AzureRmAlias/Mappings.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
<Content Include="*.Netcore.psd1" CopyToOutputDirectory="PreserveNewest" />
<Content Include="*.psm1" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="AzureRmAlias\Mappings.json" />
</ItemGroup>

<Target Name="CopyFiles" AfterTargets="Build">
<Copy SourceFiles="@(PreLoadAssemblies)" DestinationFolder="$(TargetDir)\PreloadAssemblies" />
Expand Down
Binary file removed tools/AliasMapping.json
Binary file not shown.
7 changes: 3 additions & 4 deletions tools/CreateAliasMapping.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mapping = @{}
$mapping = [ordered]@{}

$psd1s = Get-ChildItem -Path $PSScriptRoot/../src -Recurse | `
Where-Object {($_.Name -like "*AzureRM*psd1" -or $_.Name -eq "Azure.AnalysisServices.psd1" -or $_.Name -eq "Azure.Storage.psd1") `
Expand All @@ -8,7 +8,7 @@ $psd1s | ForEach-Object {
$name = (($_.Name -replace "AzureRM", "Az") -replace "Azure", "Az") -replace ".psd1", ""
if (!($mapping.Contains($name)))
{
$mapping.Add($name, @{})
$mapping.Add($name, [ordered]@{})
}
Import-LocalizedData -BindingVariable psd1info -BaseDirectory $_.DirectoryName -FileName $_.Name
$psd1info.CmdletsToExport | ForEach-Object {
Expand Down Expand Up @@ -40,5 +40,4 @@ $psd1s | ForEach-Object {
}
}

$json = ConvertTo-Json $mapping
$json -replace "`"", "`'" | Out-File $PSScriptRoot/AliasMapping.json
ConvertTo-Json $mapping | Set-Content -Path $PSScriptRoot/../src/ResourceManager/Profile/Commands.Profile/AzureRmAlias/Mappings.json