Skip to content
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

[templates] remove Directory.Build.targets, add @(ProjectCapability) #1433

Merged
merged 4 commits into from
Jul 26, 2021
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
6 changes: 6 additions & 0 deletions .nuspec/Microsoft.Maui.Controls.SingleProject.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

<PropertyGroup Condition=" '$(SingleProject)' == 'true' ">
<PlatformsProjectFolder Condition=" '$(PlatformsProjectFolder)' == '' ">Platforms\</PlatformsProjectFolder>
<!-- Required - Enable Launch Profiles for .NET 6 iOS/Android -->
<_KeepLaunchProfiles>true</_KeepLaunchProfiles>
<!-- Android -->
<EnableDefaultAndroidItems>false</EnableDefaultAndroidItems>
<AndroidProjectFolder Condition=" '$(AndroidProjectFolder)' == '' ">$(PlatformsProjectFolder)Android\</AndroidProjectFolder>
Expand Down Expand Up @@ -78,6 +80,10 @@
<ItemGroup Condition=" '$(SingleProject)' == 'true' ">
<ProjectCapability Include="MauiSingleProject" />
<ProjectCapability Include="LaunchProfiles" />
<!-- If VS is older than Dev17 -->
<ProjectCapability Include="XamarinStaticLaunchProfiles" Condition=" '$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' &lt; '17.0' " />
<!-- Otherwise define LaunchProfilesGroupByPlatformFilters by default -->
<ProjectCapability Include="LaunchProfilesGroupByPlatformFilters" Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &gt;= '17.0' " />
Redth marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

</Project>
22 changes: 1 addition & 21 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,7 @@
<Import Project="eng\AndroidX.targets" />
<Import Project="eng\Microsoft.Extensions.targets" />

<!-- Temporarily disable the linker for net6.0-ios and net6.0-maccatalyst until we get machine pools with Big Sur and Xcode 12.5 is stable -->
<PropertyGroup Condition=" '$(CI)' == 'true' ">
<PublishTrimmed Condition=" '$(TargetFramework)' == 'net6.0-ios' or '$(TargetFramework)' == 'net6.0-maccatalyst' ">false</PublishTrimmed>
</PropertyGroup>

<PropertyGroup Condition="'$(SingleProject)' == 'true'">
<!-- Required - Enable Launch Profiles for .NET 6 iOS/Android -->
<_KeepLaunchProfiles>true</_KeepLaunchProfiles>
</PropertyGroup>
<ItemGroup Condition="'$(SingleProject)' == 'true'">
<!-- Required - Setup Single Project features -->
<ProjectCapability Include="MauiSingleProject" />

<!-- Optional - Enables a list of TFM's and device categories in the debug menu -->
<!-- This allows easily toggling of debug target TFM by selecting the platform -->
<!-- If removed, Top level debug targets show as a list of devices for the selected TFM -->
<ProjectCapability Include="XamarinStaticLaunchProfiles" />
</ItemGroup>

<!-- HACK: Prevent the Platform checks -->
<Target Name="ValidateWinUIPlatform" />
<Target Name="BinPlaceBootstrapDll" />

<!-- semi HACK: by default, WinUI includes all @(None) with .bmp/.png as @(Content) and adds that to the .pri -->
Expand All @@ -39,4 +19,4 @@
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.18362.19" />
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion src/DotNet/DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<_WorkloadFiles Include="$(_InstallTempDirectory)data/WorkloadManifest.*" />
</ItemGroup>
<CopyWorkloadFiles
Name="Microsoft.NET.Sdk.Maui"
Name="microsoft.net.sdk.maui"
Files="@(_WorkloadFiles)"
WorkloadDirectory="$(MSBuildExtensionsPath)../../sdk-manifests/$(DotNetPreviewVersionBand)"
VersionBand="$(DotNetPreviewVersionBand)"
Expand Down
26 changes: 0 additions & 26 deletions src/Templates/src/templates/maui-blazor/Directory.Build.targets

This file was deleted.

26 changes: 0 additions & 26 deletions src/Templates/src/templates/maui-mobile/Directory.Build.targets

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@
<Analyzer Include="$(MSBuildThisFileDirectory)../targets/Microsoft.Maui.Controls.Xaml.dll" />
<Analyzer Include="$(MSBuildThisFileDirectory)../targets/Microsoft.Maui.Controls.SourceGen.dll" />
</ItemGroup>
<!-- @(ProjectCapability) used to identify parts of Maui -->
<ItemGroup>
<ProjectCapability Include="Maui" Condition=" '$(UseMaui)' == 'true' " />
<ProjectCapability Include="MauiAssets" Condition=" '$(UseMaui)' == 'true' or '$(UseMauiAssets)' == 'true' " />
<ProjectCapability Include="MauiBlazor" Condition=" '$(UsingMicrosoftNETSdkRazor)' == 'true' " />
<ProjectCapability Include="MauiCore" Condition=" '$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' " />
<ProjectCapability Include="MauiEssentials" Condition=" '$(UseMaui)' == 'true' or '$(UseMauiEssentials)' == 'true' " />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Workarounds for WinUI when $(SingleProject) is true -->
<Project>
<!-- Required - Overwrite tasks that are not needed when multitargeting -->
<Target Name="BinPlaceBootstrapDll" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
/>
</ItemGroup>
</Target>
<Import Project="WinUI.SingleProject.targets" Condition=" '$(SingleProject)' == 'true' " />
</Project>