Skip to content
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
39 changes: 39 additions & 0 deletions PowerShell.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,43 @@
<HighEntropyVA>true</HighEntropyVA>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
<IsWindows Condition="'$(OS)' == 'Windows_NT'">true</IsWindows>
</PropertyGroup>

<!-- Define non-windows, all configuration properties -->
<PropertyGroup Condition=" '$(IsWindows)' != 'true' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<!-- Define all OS, debug configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<!-- Define all OS, release configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<Optimize>true</Optimize>
</PropertyGroup>

<!-- Define windows, release configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' And '$(IsWindows)' == 'true' ">
<Optimize>true</Optimize>
<DebugType>full</DebugType>
</PropertyGroup>

<!-- Define non-windows, release configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' And '$(IsWindows)' != 'true' ">
<!-- Set-Date fails with optimize enabled in NonWindowsSetDate
Debugging the issues resolves the problem
-->
<Optimize>false</Optimize>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TravisEz13 Should we set true because we fixed Set-Date?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a tracking issue with all the steps: #6872 We still have some steps before we can change this.

<DebugType>portable</DebugType>
</PropertyGroup>

<!-- Define all OS, CodeCoverage configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>
</Project>
28 changes: 6 additions & 22 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ function Start-PSBuild {
"win-arm64")]
[string]$Runtime,

[ValidateSet('Linux', 'Debug', 'Release', 'CodeCoverage', '')] # We might need "Checked" as well
[ValidateSet('Debug', 'Release', 'CodeCoverage', '')] # We might need "Checked" as well
[string]$Configuration,

[switch]$CrossGen,
Expand Down Expand Up @@ -704,7 +704,7 @@ function Compress-TestContent {
function New-PSOptions {
[CmdletBinding()]
param(
[ValidateSet("Linux", "Debug", "Release", "CodeCoverage", "")]
[ValidateSet("Debug", "Release", "CodeCoverage", '')]
[string]$Configuration,

[ValidateSet("netcoreapp2.1")]
Expand Down Expand Up @@ -736,36 +736,20 @@ function New-PSOptions {

$ConfigWarningMsg = "The passed-in Configuration value '{0}' is not supported on '{1}'. Use '{2}' instead."
if (-not $Configuration) {
$Configuration = if ($Environment.IsLinux -or $Environment.IsMacOS) {
"Linux"
} elseif ($Environment.IsWindows) {
"Debug"
}
$Configuration = 'Debug'
} else {
switch ($Configuration) {
"Linux" {
if ($Environment.IsWindows) {
$Configuration = "Debug"
Write-Warning ($ConfigWarningMsg -f $switch.Current, "Windows", $Configuration)
}
}
"CodeCoverage" {
if(-not $Environment.IsWindows) {
$Configuration = "Linux"
Write-Warning ($ConfigWarningMsg -f $switch.Current, $Environment.LinuxInfo.PRETTY_NAME, $Configuration)
}
}
Default {
if ($Environment.IsLinux -or $Environment.IsMacOS) {
$Configuration = "Linux"
$Configuration = "Debug"
Write-Warning ($ConfigWarningMsg -f $switch.Current, $Environment.LinuxInfo.PRETTY_NAME, $Configuration)
}
}
}
}
Write-Verbose "Using configuration '$Configuration'"

$PowerShellDir = if ($Configuration -eq 'Linux') {
$PowerShellDir = if (!$Environment.IsWindows) {
"powershell-unix"
} else {
"powershell-win-core"
Expand Down Expand Up @@ -1460,7 +1444,7 @@ function Start-PSxUnit {

if((Test-Path $requiredDependencies) -notcontains $false)
{
$options = New-PSOptions
$options = Get-PSOptions -DefaultToNew
$Destination = "bin/$($options.configuration)/$($options.framework)"
New-Item $Destination -ItemType Directory -Force > $null
Copy-Item -Path $requiredDependencies -Destination $Destination -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,4 @@
<Compile Remove="gen\GetEventResources.cs" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@
<EmbeddedResource Remove="resources\ClipboardResources.resx" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

<ItemGroup>
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="4.5.0-rc1-26423-06" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,6 @@
<EmbeddedResource Remove="resources\ImmutableStrings.resx" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="2.7.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,4 @@
<EmbeddedResource Remove="resources\HostMshSnapinResources.resx" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@
<AssemblyName>Microsoft.PowerShell.CoreCLR.Eventing</AssemblyName>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

<ItemGroup>
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.Security.Principal.Windows" Version="4.5.0-rc1-26423-06" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,4 @@
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,4 @@
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,11 @@
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Remove="singleshell\installer\MshSecurityMshSnapin.cs" />
<Compile Remove="gen\SecurityMshSnapinResources.cs" />

<EmbeddedResource Remove="resources\SecurityMshSnapinResources.resx" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually have a blank line between groups.

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,4 @@
<Compile Remove="WsManSnapin.cs" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
16 changes: 0 additions & 16 deletions src/Microsoft.WSMan.Runtime/Microsoft.WSMan.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,4 @@
<AssemblyName>Microsoft.WSMan.Runtime</AssemblyName>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,4 @@
<EmbeddedResource Remove="resources\ErrorPackageRemoting.resx" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
12 changes: 0 additions & 12 deletions src/TypeCatalogGen/TypeCatalogGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,4 @@
<RuntimeIdentifiers>win7-x86;win7-x64;osx-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
18 changes: 1 addition & 17 deletions src/powershell-unix/powershell-unix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,4 @@
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-*" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
</Project>
16 changes: 0 additions & 16 deletions src/powershell-win-core/powershell-win-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,4 @@
<PackageReference Include="psrp.windows" Version="6.1.0-*" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Linux' ">
<DefineConstants>$(DefineConstants);UNIX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'CodeCoverage' ">
<DebugType>full</DebugType>
</PropertyGroup>

</Project>
Loading