Skip to content

Commit 7b17d0d

Browse files
committed
Made the module output folder be 'artifacts' at the repo root. Updated all references to src/Package/<CONFIG>/ResourceManager/AzureResourceManager/ that I could find. Removed legacy/unused files or logic that used this old output pathing.
1 parent 68966fa commit 7b17d0d

File tree

139 files changed

+296
-1844
lines changed

Some content is hidden

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

139 files changed

+296
-1844
lines changed

.dockerignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
**/*
33

44
# Include the build.
5-
!src/Package/Release/ResourceManager/**/*
6-
!src/Package/Debug/ResourceManager/**/*
5+
!artifacts/Release/**/*
6+
!artifacts/Debug/**/*
77
!tools/InstallationTests/NetcoreTests/**/*

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Azure PowerShell specific
22
src/Publish/
3-
src/Package/
3+
artifacts/
44
src/Stack/
55
src/local-artifacts/*
66
/tools/AzureRM/AzureRM.psm1

.travis.yml

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ before_install:
2525
# https://github.com/travis-ci/travis-ci/issues/1066#issuecomment-383489298
2626
script:
2727
- sudo dotnet msbuild build.proj /t:Full /p:Configuration=$CONFIG || travis_terminate 1
28-
# - sudo dotnet src/Package/StaticAnalysis/StaticAnalysis.Netcore.dll -p $TRAVIS_BUILD_DIR/src/Package/$CONFIG -r $TRAVIS_BUILD_DIR/src/Package/StaticAnalysis -u || travis_terminate 1
29-
# - sudo pwsh -NonInteractive -NoLogo -NoProfile -File tools/TestModuleLoading.ps1 || travis_terminate 1
30-
# - sudo dotnet test src/Azure.PowerShell.Netcore.Test.sln --filter "AcceptanceType=CheckIn&RunType!=DesktopOnly" --configuration $CONFIG --framework netcoreapp2.0
3128

3229
after_success:
3330
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ FROM mcr.microsoft.com/powershell
22

33
ARG CONFIG=Release
44

5-
COPY src/Package/${CONFIG}/ResourceManager/AzureResourceManager /usr/local/share/powershell/Modules
5+
COPY artifacts/${CONFIG} /usr/local/share/powershell/Modules
66
COPY tools/InstallationTests/NetcoreTests /azpstests

Repo.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
55
<RepoSrc>$(RepoRoot)src\</RepoSrc>
6-
<RepoArtifacts>$(RepoSrc)Package\</RepoArtifacts>
6+
<RepoArtifacts>$(RepoRoot)artifacts\</RepoArtifacts>
77
<RepoTools>$(RepoRoot)tools\</RepoTools>
88
</PropertyGroup>
99

build.proj

+35-44
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
4-
<!--
5-
Available Targets:
2+
<!--
3+
Available Targets:
64
7-
/t:Clean
8-
Removes temporary build outputs.
5+
/t:Clean
6+
Removes temporary build outputs.
97
10-
/t:Build
11-
Builds assemblies.
8+
/t:Build
9+
Builds assemblies.
1210
13-
/t:Test
14-
Runs tests
11+
/t:Test
12+
Runs tests
1513
16-
/t:Publish
17-
Creates local nuget packages and MSI
14+
/t:Publish
15+
Creates local nuget packages and MSI
1816
19-
/p:CodeSign=True
20-
Code sign binaries, mainly for official release. Default is false.
17+
/p:CodeSign=True
18+
Code sign binaries, mainly for official release. Default is false.
2119
22-
/p:CodeSign=True;DelaySign=True
23-
Test the code sign workflow locally.
20+
/p:CodeSign=True;DelaySign=True
21+
Test the code sign workflow locally.
2422
25-
/p:Scope
26-
'ServiceManagement': service management
27-
'AzureStorage': storage data plane cmdlets
28-
'Stack': Azure Stack cmdlets
29-
'Subfolder under src\ResourceManager': An individual cmdlet module
30-
By default, it builds everything
23+
/p:Scope
24+
'ServiceManagement': service management
25+
'AzureStorage': storage data plane cmdlets
26+
'Stack': Azure Stack cmdlets
27+
'Subfolder under src\ResourceManager': An individual cmdlet module
28+
By default, it builds everything
3129
32-
/p:SkipHelp=True
33-
Skips help generation, mainly for local builds to save time.
30+
/p:SkipHelp=True
31+
Skips help generation, mainly for local builds to save time.
3432
35-
/p:SkipNugetRestore=True
36-
Skips nuget restore, mainly for local builds to save time when you have already restored nugets.
33+
/p:SkipNugetRestore=True
34+
Skips nuget restore, mainly for local builds to save time when you have already restored nugets.
3735
38-
/p:SkipDependencyAnalysis=True
39-
Skips build validation, mainly for local builds to save time.
36+
/p:SkipDependencyAnalysis=True
37+
Skips build validation, mainly for local builds to save time.
4038
41-
/p:QuickBuild=true
42-
Same thing as doing SkipHelp, SkipNugetRestore, and SkipDependencyAnalysis
39+
/p:QuickBuild=true
40+
Same thing as doing SkipHelp, SkipNugetRestore, and SkipDependencyAnalysis
41+
-->
42+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4343

44-
-->
44+
<Import Project="$(MSBuildThisFileDirectory)Repo.props" />
4545

4646
<!-- Define default build properties -->
4747
<PropertyGroup>
@@ -255,15 +255,6 @@
255255
<Artifacts Include="@(GetAllFiles->'%(RootDir)%(Directory)'->Distinct())" />
256256
</ItemGroup>
257257
<RemoveDir Directories="%(Artifacts.Identity)" ContinueOnError="true" />
258-
259-
<ItemGroup>
260-
<ExtraPsdFiles Include="$(PackageDirectory)\$(Configuration)\ResourceManager\AzureResourceManager\Az.Resources\Az.Tags.psd1" />
261-
<ExtraPsdFiles Include="$(PackageDirectory)\$(Configuration)\ResourceManager\AzureResourceManager\Az.Websites\Az.Resources.psd1" />
262-
<ExtraPsdFiles Include="$(PackageDirectory)\$(Configuration)\ResourceManager\AzureResourceManager\Az.Websites\Az.Tags.psd1" />
263-
<ExtraPsdFiles Include="$(PackageDirectory)\$(Configuration)\ResourceManager\AzureResourceManager\Az.Network\Az.Resources.psd1" />
264-
<ExtraPsdFiles Include="$(PackageDirectory)\$(Configuration)\ResourceManager\AzureResourceManager\Az.Network\Az.Tags.psd1" />
265-
</ItemGroup>
266-
<Delete Files="@(ExtraPsdFiles->'%(FullPath)')" />
267258
<!-- TODO: </REMOVE THIS SECTION> -->
268259

269260

@@ -430,7 +421,7 @@
430421
<SkipHelpValue Condition=" '$(SkipHelp)' == 'true' ">-s</SkipHelpValue>
431422
</PropertyGroup>
432423
<!-- TODO: Use '-m @(ModulesChanged)' in command when FilterBuild is fixed. -->
433-
<!-- <Exec Command="dotnet $(MSBuildThisFileDirectory)src/Package/StaticAnalysis/StaticAnalysis.Netcore.dll -p $(MSBuildThisFileDirectory)src/Package/$(Configuration) -r $(MSBuildThisFileDirectory)src/Package/StaticAnalysis $(SkipHelpValue) -u" /> -->
424+
<!-- <Exec Command="dotnet $(MSBuildThisFileDirectory)artifacts/StaticAnalysis/StaticAnalysis.Netcore.dll -p $(MSBuildThisFileDirectory)artifacts/$(Configuration) -r $(MSBuildThisFileDirectory)artifacts/StaticAnalysis $(SkipHelpValue) -u" /> -->
434425

435426
<OnError ExecuteTargets="StaticAnalysisErrorMessage" />
436427
</Target>
@@ -449,7 +440,7 @@
449440
<PropertyGroup>
450441
<SkipHelpValue Condition=" '$(SkipHelp)' == 'true' ">-s</SkipHelpValue>
451442
</PropertyGroup>
452-
<Exec Command="dotnet $(MSBuildProjectDirectory)\src\Package\StaticAnalysis.Netcore.dll -p $(MSBuildProjectDirectory)\src\Package\$(Configuration) -r $(MSBuildProjectDirectory)\src\Package $(SkipHelpValue) -u -m @(ModulesChanged)" />
443+
<Exec Command="dotnet $(MSBuildProjectDirectory)\artifacts\StaticAnalysis.Netcore.dll -p $(MSBuildProjectDirectory)\artifacts\$(Configuration) -r $(MSBuildProjectDirectory)\artifacts $(SkipHelpValue) -u -m @(ModulesChanged)" />
453444

454445
<OnError ExecuteTargets="StaticAnalysisErrorMessage"/>
455446
</Target>
@@ -514,7 +505,7 @@
514505
</Target>
515506

516507
<Target Name="BinScopeErrorMessage">
517-
<Error Text="Binscope failed, please check the files in src/Package/BinScope" />
508+
<Error Text="Binscope failed, please check the files in artifacts/BinScope" />
518509
</Target>
519510

520511
<Target Name="RunPoliCheck">
@@ -523,7 +514,7 @@
523514
</Target>
524515

525516
<Target Name="PoliCheckErrorMessage">
526-
<Error Text="PoliCheck failed with a Severity 1 issue, please check the report at in src/Package/PoliCheck-Scan.html" />
517+
<Error Text="PoliCheck failed with a Severity 1 issue, please check the report at in artifacts/PoliCheck-Scan.html" />
527518
</Target>
528519

529520
</Project>

documentation/Debugging-StaticAnalysis-Errors.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ Our StaticAnalysis tools help us ensure our modules follow PowerShell guidelines
1212
## How to know if you have a StaticAnalysis Error
1313
If your build is failing, click on the Jenkins job inside the PR (marked as "Default" within checks). Then check the Console Output within the Jenkins job. If you have this error, then you have failed StaticAnalysis:
1414
```
15-
d:\workspace\powershell\build.proj(511,5): error MSB3073: The command "d:\workspace\powershell\src\Package\StaticAnalysis.exe d:\workspace\powershell\src\Package\Debug d:\workspace\powershell\src\Package true false" exited with code 255.
15+
d:\workspace\powershell\build.proj(511,5): error MSB3073: The command "d:\workspace\powershell\artifacts\StaticAnalysis.exe d:\workspace\powershell\artifacts\Debug d:\workspace\powershell\artifacts true false" exited with code 255.
1616
```
1717

1818
## Where to find StaticAnalysis reports
1919

2020
The StaticAnalysis reports could show up in two different places in the CI build:
2121
- On the status page in Jenkins, under the Build Artifacts: the relevant files are `BreakingChangeIssues.csv`, `SignatureIssues.csv`, and/or `HelpIssues.csv`.
22-
- On the status page in Jenkins, click Build Artifacts then navigate to src/Package. You will see `BreakingChangeIssues.csv`, `SignatureIssues.csv`, and/or `HelpIssues.csv`.
22+
- On the status page in Jenkins, click Build Artifacts then navigate to artifacts. You will see `BreakingChangeIssues.csv`, `SignatureIssues.csv`, and/or `HelpIssues.csv`.
2323

24-
Locally, the StaticAnalysis report will show up under Azure-PowerShell/src/Package. You will see `BreakingChangeIssues.csv`, `SignatureIssues.csv`, and/or `HelpIssues.csv`. You can generate these files by running
24+
Locally, the StaticAnalysis report will show up under Azure-PowerShell/artifacts. You will see `BreakingChangeIssues.csv`, `SignatureIssues.csv`, and/or `HelpIssues.csv`. You can generate these files by running
2525
```
2626
msbuild build.proj
2727
```

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ Now, you'll need to edit the solution file. Open the `<SERVICE>.sln` in your tex
168168

169169
After the solution file is updated, save and close it. Now, open the solution file in Visual Studio. Right click on the `Commands.<SERVICE>` project in the `Solution Explorer` and select `Unload project`. Right click on the unloaded project and select `Edit Commands.<SERVICE>.csproj`. Once opened, ensure that the following things are changed:
170170
- The `AssemblyNamespace` and `RootNamespace` attributes of the project _must_ be changed to `Microsoft.Azure.PowerShell.Cmdlets.<SERVICE>`. If these changes are not made, then the assembly produced from this project is not be signed and results in errors when users try to use your module.
171-
- Change the `OutputPath` attribute to `$(ProjectDir)..\..\..\Package\$(Configuration)\ResourceManager\AzureResourceManager\Az.<SERVICE>\`
172171
- Change the particular `<ItemGroup>` containing `<None Include="Az.<SERVICE>.psd1">`
173172

174173
Right click on the project and select `Reload project`, and then build the solution by either right clicking on the solution and selecting `Rebuild Solution` or, from the top of Visual Studio, selecting `Build > Rebuild Solution`. If the build does not succeed, open the `.csproj` file and ensure there are no errors.
@@ -198,7 +197,7 @@ To import modules automatically when debug has started, follow the below steps:
198197

199198
- In the **Debug** tab mentioned previously, go to **Start Options**
200199
- Import the Profile module, along with the module you are testing, by pasting the following in the **Command line arguments** box (_note_: you have to update the <PATH_TO_REPO> and <SERVICE> values provided below):
201-
- `-NoExit -Command "Import-Module <PATH_TO_REPO>/src/Package/Debug/ResourceManager/AzureResourceManager/Az.Accounts/Az.Accounts.psd1;Import-Module <PATH_TO_REPO>/src/Package/Debug/ResourceManager/AzureResourceManager/Az.<SERVICE>/Az.<SERVICE>.psd1;$VerbosePreference='Continue'"`
200+
- `-NoExit -Command "Import-Module <PATH_TO_REPO>/artifacts/Debug/Az.Accounts/Az.Accounts.psd1;Import-Module <PATH_TO_REPO>/artifacts/Debug/Az.<SERVICE>/Az.<SERVICE>.psd1;$VerbosePreference='Continue'"`
202201
- **Note**: if you do not see all of the changes you made to the cmdlets when importing your module in a PowerShell session (_e.g.,_ a cmdlet you added is not recognized as a cmdlet), you may need to delete any existing Azure PowerShell modules that you have on your machine (installed through the PowerShell Gallery) before you import your module.
203202

204203
## Adding Help Content
@@ -303,7 +302,7 @@ $subcriptions = $job | Receive-Job
303302

304303
## Argument Completers
305304

306-
PowerShell uses Argument Completers to provide tab completion for users. At the moment, Azure PowerShell has two specific argument completers that should be applied to relevant parameters, and one generic argument completer that can be used to tab complete with a given list of values. To test the completers, run a complete build after you have added the completers (`msbuild build.proj`) and ensure that the psm1 file (`Az.<Service>.psm1`) has been added to the psd1 file found in `src/Package/Debug/ResourceManager/AzureResourceManager/AzureRM.<Service>/AzureRM.<Service>.psd1` under "Root Module".
305+
PowerShell uses Argument Completers to provide tab completion for users. At the moment, Azure PowerShell has two specific argument completers that should be applied to relevant parameters, and one generic argument completer that can be used to tab complete with a given list of values. To test the completers, run a complete build after you have added the completers (`msbuild build.proj`) and ensure that the psm1 file (`Az.<Service>.psm1`) has been added to the psd1 file found in `artifacts/Debug/Az.<Service>/Az.<Service>.psd1` under "Root Module".
307306

308307
### Resource Group Completer
309308

documentation/development-docs/generate-format.ps1xml-file.md

+16-18
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,13 @@ This will place the column at the very beginning of the table.
315315
PS E:\git\azure-powershell> msbuild build.proj /p:SkipHelp=true
316316
```
317317

318-
* After the build is completed you can find build artifacts in the ```.\src\Package\Debug``` folder:
318+
* After the build is completed you can find build artifacts in the ```.\artifacts\Debug``` folder:
319319

320320
```Powershell
321-
PS E:\git\azure-powershell> ls .\src\Package\Debug\
321+
PS E:\git\azure-powershell> ls .\artifacts\Debug\
322322

323323

324-
Directory: E:\git\azure-powershell\src\Package\Debug
324+
Directory: E:\git\azure-powershell\artifacts\Debug
325325

326326

327327
Mode LastWriteTime Length Name
@@ -340,33 +340,33 @@ d----- 4/25/2018 4:35 PM Storage
340340
PS E:\git\azure-powershell> Import-Module E:\git\azure-powershell\tools\RepoTasks\RepoTasks.Cmdlets\bin\Debug\RepoTasks.Cmdlets.dll
341341
```
342342
3. Run the **New-FormatPs1Xml** cmdlet.
343-
* The cmdlet has one required argument **-ModulePath** - a path to a module manifest (psd1) file. Since in our example we are using the Get-AzSubscription cmdlet from the Az.Profile module we need to specify path to the Az.Profile module manifest which is
343+
* The cmdlet has one required argument **-ModulePath** - a path to a module manifest (psd1) file. Since in our example we are using the Get-AzSubscription cmdlet from the Az.Accounts module we need to specify path to the Az.Accounts module manifest which is
344344
```
345-
E:\git\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\Az.Profile\Az.Profile.psd1
345+
E:\git\azure-powershell\artifacts\Debug\Az.Accounts\Az.Accounts.psd1
346346
```
347347
* Also with the cmdlet we need to use **-OnlyMarkedProperties** switch.
348348
* You may also want to specify an output path for the generated file with the **-OutputPath** argument. If not specified this is current folder.
349349

350350
```
351-
PS E:\git\azure-powershell> New-FormatPs1Xml -ModulePath .\src\Package\Debug\ResourceManager\AzureResourceManager\Az.Profile\Az.Profile.psd1 -OnlyMarkedProperties
351+
PS E:\git\azure-powershell> New-FormatPs1Xml -ModulePath .\artifacts\Debug\Az.Accounts\Az.Accounts.psd1 -OnlyMarkedProperties
352352

353353
E:\git\azure-powershell\Microsoft.Azure.Commands.Profile.generated.format.ps1xml
354354
```
355355
* After a successful run the cmdlet outputs the full path to the generated format.ps1xml file.
356356

357357
# How to test the format.ps1xml file.
358358

359-
**Note:** All the paths used in the example in the section are under **_azure-powershell/src/Package/Debug_**
359+
**Note:** All the paths used in the example in the section are under **_azure-powershell/artifacts/Debug_**
360360

361361
1. **Copy** the generated format.ps1xml file to the built module folder (this is where your module manifest file psd1 is located). In our example the module folder is
362362
```
363-
E:\git\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\Az.Profile
363+
E:\git\azure-powershell\artifacts\Debug\Az.Accounts
364364
```
365365

366366
2. Modify your module manifest file.
367-
* In our example the module manifest is Az.Profile.psd1:
367+
* In our example the module manifest is Az.Accounts.psd1:
368368
```
369-
E:\git\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\Az.Profile\Az.Profile.psd1
369+
E:\git\azure-powershell\artifacts\Debug\Az.Accounts\Az.Accounts.psd1
370370
```
371371

372372
* In the module manifest file there is a variable called **FormatsToProcess** to reference format.ps1xml files.
@@ -387,9 +387,9 @@ FunctionsToExport = @()
387387

388388
# script omitted for brevity
389389
```
390-
3. Open a **PowerShell window** and **import** your module. In our example it is Az.Profile:
390+
3. Open a **PowerShell window** and **import** your module. In our example it is Az.Accounts:
391391
```Powershell
392-
PS C:\> Import-Module E:\git\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\Az.Profile\Az.Profile.psd1
392+
PS C:\> Import-Module E:\git\azure-powershell\artifacts\Debug\Az.Accounts\Az.Accounts.psd1
393393
```
394394

395395
4. Try your cmdlet out. In our example it is Get-AuzreRmSubsription:
@@ -423,8 +423,8 @@ c9cbd920-c00c-427c-852b-c329e824c3a8 Azure SDK Powershell Test Enabled 72f988bf-
423423
<SubType>Designer</SubType>
424424
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
425425
</Content>
426-
<None Include="..\AzureRM.Profile.psd1">
427-
<Link>AzureRM.Profile.psd1</Link>
426+
<None Include="..\Az.Accounts.psd1">
427+
<Link>Az.Accounts.psd1</Link>
428428
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
429429
</None>
430430
<Content Include="Microsoft.Azure.Commands.Profile.types.ps1xml">
@@ -433,12 +433,10 @@ c9cbd920-c00c-427c-852b-c329e824c3a8 Azure SDK Powershell Test Enabled 72f988bf-
433433
</Content>
434434
<None Include="MSSharedLibKey.snk" />
435435
<None Include="packages.config" />
436-
<None Include="StartupScripts\*.ps1">
437-
<!-- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> -->
438-
</None>
436+
<None Include="StartupScripts\*.ps1" />
439437
</ItemGroup>
440438
```
441-
3. Add the generated format.ps1xml file to your source module manifest **FormatsToProcess** variable. In our example this is [src/ResourceManager/Profile/Az.Profile.psd1](https://github.com/Azure/azure-powershell/blob/master/src/ResourceManager/Profile/Az.Profile.psd1) file:
439+
3. Add the generated format.ps1xml file to your source module manifest **FormatsToProcess** variable. In our example this is [src/ResourceManager/Profile/Az.Accounts.psd1](https://github.com/Azure/azure-powershell/blob/master/src/ResourceManager/Profile/Az.Accounts.psd1) file:
442440
```Powershell
443441
# script omitted for brevity
444442

0 commit comments

Comments
 (0)