Skip to content

Commit 875402a

Browse files
author
Sergei Vorobev
committed
Create separate Top-level directory per platform
- Replace src\powershell top level project by two new root-level projects: - src\powershell-unix - src\powershell-windows - Break src\Modules into more granular structure: - Shared - Windows+Unix-Core - Windows-Core - Windows-Core+Full - Windows-Full - To be created: Unix-Core. We will do it as a separate PR - Fix PowerShell#1122 : Platform-specific set of Modules (and assemblies) - Fix Start-TypeGen to work with new top level folders layout
1 parent 28ded78 commit 875402a

35 files changed

Lines changed: 172 additions & 66 deletions

File tree

build.psm1

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,6 @@ function New-PSOptions {
346346
# Add .NET CLI tools to PATH
347347
Find-Dotnet
348348

349-
if ($FullCLR) {
350-
$Top = "$PSScriptRoot/src/Microsoft.PowerShell.ConsoleHost"
351-
} else {
352-
$Top = "$PSScriptRoot/src/powershell"
353-
}
354-
Write-Verbose "Top project directory is $Top"
355-
356349
if (-not $Configuration) {
357350
$Configuration = if ($IsLinux -or $IsOSX) {
358351
"Linux"
@@ -362,6 +355,21 @@ function New-PSOptions {
362355
Write-Verbose "Using configuration '$Configuration'"
363356
}
364357

358+
if ($FullCLR) {
359+
$Top = "$PSScriptRoot/src/Microsoft.PowerShell.ConsoleHost"
360+
} else {
361+
if ($Configuration -eq 'Linux')
362+
{
363+
$Top = "$PSScriptRoot/src/powershell-unix"
364+
}
365+
else
366+
{
367+
$Top = "$PSScriptRoot/src/powershell-windows"
368+
}
369+
}
370+
Write-Verbose "Top project directory is $Top"
371+
372+
365373
if (-not $Framework) {
366374
$Framework = if ($FullCLR) {
367375
"net451"
@@ -1072,7 +1080,8 @@ function Start-TypeGen
10721080
Push-Location "$PSScriptRoot/src/TypeCatalogParser"
10731081
try
10741082
{
1075-
dotnet run
1083+
$topPath = if ($IsWindows) {'../powershell-windows'} else {'../powershell-unix'}
1084+
dotnet run $topPath
10761085
}
10771086
finally
10781087
{

src/Microsoft.PowerShell.ConsoleHost/project.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"mappings": {
1616
"Modules/" : {
1717
"include": [
18-
"../Modules/Full",
18+
"../Modules/Windows-Full",
19+
"../Modules/Windows-Core+Full",
1920
"../Modules/Shared"
2021
],
2122
"exclude": [
@@ -34,7 +35,8 @@
3435
"mappings": {
3536
"Modules/" : {
3637
"include": [
37-
"../Modules/Full",
38+
"../Modules/Windows-Full",
39+
"../Modules/Windows-Core+Full",
3840
"../Modules/Shared"
3941
],
4042
"exclude": [
@@ -56,15 +58,8 @@
5658
}
5759
},
5860

59-
6061
"dependencies": {
61-
"Microsoft.PowerShell.PSReadLine": "1.0.0-*",
62-
"Microsoft.PowerShell.Commands.Diagnostics": "1.0.0-*",
63-
"Microsoft.PowerShell.Commands.Management": "1.0.0-*",
64-
"Microsoft.PowerShell.Commands.Utility": "1.0.0-*",
65-
"Microsoft.PowerShell.LocalAccounts": "1.0.0-*",
66-
"Microsoft.PowerShell.PackageManagement": "1.0.0-*",
67-
"Microsoft.Management.Infrastructure.CimCmdlets": "1.0.0-*"
62+
"System.Management.Automation": "1.0.0-*"
6863
},
6964

7065
"frameworks": {
@@ -94,15 +89,22 @@
9489
},
9590
"net451": {
9691
"dependencies": {
97-
"Microsoft.PowerShell.ScheduledJob": "1.0.0-*",
98-
"Microsoft.PowerShell.Workflow.ServiceCore": "1.0.0-*",
99-
"Microsoft.PowerShell.GraphicalHost": "1.0.0-*",
92+
"Microsoft.Management.Infrastructure.CimCmdlets": "1.0.0-*",
10093
"Microsoft.PowerShell.Activities": "1.0.0-*",
94+
"Microsoft.PowerShell.Commands.Diagnostics": "1.0.0-*",
95+
"Microsoft.PowerShell.Commands.Management": "1.0.0-*",
96+
"Microsoft.PowerShell.Commands.Utility": "1.0.0-*",
10197
"Microsoft.PowerShell.Core.Activities": "1.0.0-*",
10298
"Microsoft.PowerShell.Diagnostics.Activities": "1.0.0-*",
99+
"Microsoft.PowerShell.GraphicalHost": "1.0.0-*",
100+
"Microsoft.PowerShell.LocalAccounts": "1.0.0-*",
103101
"Microsoft.PowerShell.Management.Activities": "1.0.0-*",
102+
"Microsoft.PowerShell.PackageManagement": "1.0.0-*",
103+
"Microsoft.PowerShell.PSReadLine": "1.0.0-*",
104+
"Microsoft.PowerShell.ScheduledJob": "1.0.0-*",
104105
"Microsoft.PowerShell.Security.Activities": "1.0.0-*",
105106
"Microsoft.PowerShell.Utility.Activities": "1.0.0-*",
107+
"Microsoft.PowerShell.Workflow.ServiceCore": "1.0.0-*",
106108
"Microsoft.WSMan.Management.Activities": "1.0.0-*"
107109
}
108110
}

src/Modules/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ Content files includes:
1111

1212
These files are copied as-is by `dotnet`
1313

14-
- **Shared** is shared between all flavours
15-
- **Full** for FullCLR (Windows)
16-
- **Core** for CoreCLR (all platforms)
14+
- Shared (shared between all variations)
15+
- Windows+Unix-Core
16+
- Windows-Core
17+
- Windows-Core+Full
18+
- Windows-Full
1719

1820
Notes
1921
-----------
2022

21-
* We have files with the same names in "Full" and "Core" folders.
23+
We have files with the same names in different folders.
2224
That means that the contents of these two files are different.
23-
I.e. if it's .psd1 file, it could be because `CmdletsToExport` are different for different platforms.
24-
25-
* Also, we should never have files with the same names under "Full" and "Shared" (or "Core" and "Shared").
25+
I.e. if it's .psd1 file, it could be because `CmdletsToExport`
26+
are different for different runtimes (platforms) or frameworks.

src/Modules/Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 renamed to src/Modules/Windows+Unix-Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1

File renamed without changes.

src/Modules/Core/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 renamed to src/Modules/Windows+Unix-Core/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1

File renamed without changes.

src/Modules/Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 renamed to src/Modules/Windows+Unix-Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1

File renamed without changes.
File renamed without changes.

src/Modules/Shared/Microsoft.PowerShell.LocalAccounts/LocalAccounts.format.ps1xml renamed to src/Modules/Windows-Core+Full/Microsoft.PowerShell.LocalAccounts/LocalAccounts.format.ps1xml

File renamed without changes.

src/Modules/Shared/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1 renamed to src/Modules/Windows-Core+Full/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1

File renamed without changes.

src/Modules/Shared/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 renamed to src/Modules/Windows-Core+Full/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1

File renamed without changes.

0 commit comments

Comments
 (0)