Skip to content

Commit

Permalink
Fixes to improve IDE usage
Browse files Browse the repository at this point in the history
The `Set Startup Project` button isn't working unless we remove:

    <ProjectCapability Include="Maui" />

I made a new `$(_ExcludeMauiProjectCapability)` MSBuild property, so
we can set an `%_ExcludeMauiProjectCapability%` environment variable
in `dogfood.ps1`.

I also removed some places we were setting MacCatalyst
`$(RuntimeIdentifier)` that was confusing the IDE.
`$(RuntimeIdentifier)` does not need to be set in library projects,
only app projects.
  • Loading branch information
jonathanpeppers committed Mar 19, 2021
1 parent 79e4cbb commit a0dd9d6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .nuspec/Microsoft.Maui.Controls.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<ItemGroup>
<ProjectCapability Include="XamarinForms" />
<ProjectCapability Include="Maui" />
<ProjectCapability Include="Maui" Condition="'$(_ExcludeMauiProjectCapability)' != 'true'" />
</ItemGroup>

<!-- Check Tasks ABI and other validations -->
Expand Down
5 changes: 5 additions & 0 deletions eng/dogfood.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ $oldDOTNET_ROOT=$env:DOTNET_ROOT
$oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
$oldDOTNET_MULTILEVEL_LOOKUP=$env:DOTNET_MULTILEVEL_LOOKUP
$oldMSBuildEnableWorkloadResolver=$env:MSBuildEnableWorkloadResolver
$old_ExcludeMauiProjectCapability=$env:_ExcludeMauiProjectCapability
$oldPATH=$env:PATH

try {
Expand All @@ -78,6 +79,9 @@ try {
# This enables workload support inside the IDE
$env:MSBuildEnableWorkloadResolver=$true

# This disables the Maui @(ProjectCapability), a temporary workaround for 16.9
$env:_ExcludeMauiProjectCapability=$true

# Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
$env:PATH=($env:DOTNET_ROOT + ";" + $env:PATH)

Expand All @@ -90,6 +94,7 @@ try {
$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
$env:DOTNET_MULTILEVEL_LOOKUP=$oldDOTNET_MULTILEVEL_LOOKUP
$env:MSBuildEnableWorkloadResolver=$oldMSBuildEnableWorkloadResolver
$env:_ExcludeMauiProjectCapability=$old_ExcludeMauiProjectCapability
$env:PATH=$oldPATH
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android</TargetFrameworks>
<TargetFramework>net6.0-android</TargetFramework>
<RootNamespace>Microsoft.Maui.Controls.Compatibility.Android</RootNamespace>
<AssemblyName>Microsoft.Maui.Controls.Compatibility.Android.FormsViewGroup</AssemblyName>
<OutputType>Library</OutputType>
Expand Down
2 changes: 0 additions & 2 deletions src/Compatibility/Core/src/Compatibility-net6.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<RootNamespace>Microsoft.Maui.Controls.Compatibility</RootNamespace>
<AssemblyName>Microsoft.Maui.Controls.Compatibility</AssemblyName>
<Nullable>disable</Nullable>
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net6.0-ios' ">ios-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net6.0-maccatalyst' ">maccatalyst-x64</RuntimeIdentifier>
<EnableDefaultItems>false</EnableDefaultItems>
<AndroidRoot>Android\</AndroidRoot>
<iOSRoot>iOS\</iOSRoot>
Expand Down
2 changes: 0 additions & 2 deletions src/Core/src/Core-net6.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<RootNamespace>Microsoft.Maui</RootNamespace>
<AssemblyName>Microsoft.Maui</AssemblyName>
<Nullable>enable</Nullable>
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net6.0-ios' ">ios-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net6.0-maccatalyst' ">maccatalyst-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
<PackageId>Microsoft.Maui.Core</PackageId>
Expand Down
2 changes: 0 additions & 2 deletions src/Package/Package-net6.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<RootNamespace>Microsoft.Maui</RootNamespace>
<AssemblyName>Microsoft.Maui.Package</AssemblyName>
<Nullable>enable</Nullable>
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net6.0-ios' ">ios-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net6.0-maccatalyst' ">maccatalyst-x64</RuntimeIdentifier>
<IncludeBuildOutput>False</IncludeBuildOutput>
<NoWarn>$(NoWarn);NU5100;NU5128;</NoWarn>
</PropertyGroup>
Expand Down

0 comments on commit a0dd9d6

Please sign in to comment.