uno/build/uno.ui.targets

80 строки
3.9 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SourceGeneratorBasePath Condition="'$(SourceGeneratorBasePath)'==''">..\</SourceGeneratorBasePath>
<UnoUIMSBuildTasksTargetPath Condition="'$(UnoUIMSBuildTasksTargetPath)'==''"></UnoUIMSBuildTasksTargetPath>
</PropertyGroup>
<Import Project="$(SourceGeneratorBasePath)Uno.UI.SourceGenerators.props" />
<Import Project="$(UnoUIMSBuildTasksTargetPath)Uno.UI.Tasks.targets" />
<Target Name="_UnoFeatureDefines"
BeforeTargets="BeforeCompile">
<!--
Defines Uno features.
Note to contributors: Adding a feature here allows for smoother upgrade
to a more recent version of uno. These constants are defined in the code
that uses Uno, so conditional compilation can be used to detect the presence
of breaking changes.
-->
<PropertyGroup>
<UnoDefineConstants>$(UnoDefineConstants);HAS_UNO</UnoDefineConstants>
<UnoDefineConstants>$(UnoDefineConstants);UNO_HAS_FRAMEWORKELEMENT_MEASUREOVERRIDE</UnoDefineConstants>
<UnoDefineConstants>$(UnoDefineConstants);UNO_HAS_NO_IDEPENDENCYOBJECT</UnoDefineConstants>
</PropertyGroup>
<!-- Merge the UnoDefineConstants with the existing constants -->
<CreateProperty Value="$(DefineConstants);$(UnoDefineConstants)">
<Output TaskParameter="Value" PropertyName="DefineConstants" />
</CreateProperty>
</Target>
<Target Name="ReplaceRefAssemblies" AfterTargets="_ResolveAssemblies" Condition="'$(AndroidApplication)'=='true'">
<!-- This is a workaround for https://github.com/xamarin/xamarin-android/issues/1162#issuecomment-359475008 -->
<ItemGroup>
<ResolvedAssembliesFixedWindows Include="@(ResolvedAssemblies->Replace('\ref\','\lib\'))" />
<ResolvedAssembliesFixedUnix Include="@(ResolvedAssemblies->Replace('/ref/','/lib/'))" />
<ResolvedAssembliesFixed Include="@(ResolvedAssembliesFixedWindows)" Condition="@(ResolvedAssembliesFixedWindows) != @(ResolvedAssemblies)" />
<ResolvedAssembliesFixed Include="@(ResolvedAssembliesFixedUnix)" Condition="@(ResolvedAssembliesFixedUnix) != @(ResolvedAssemblies)" />
<ResolvedAssemblies Condition="'@(ResolvedAssembliesFixed->Count())' &gt; 0" Remove="@(ResolvedAssemblies)" />
<ResolvedAssemblies Include="@(ResolvedAssembliesFixed)" />
</ItemGroup>
</Target>
<ItemGroup>
<!-- Properties that will be automatically forwarded to the source generators -->
<UnoSourceGeneratorAdditionalProperty Include="UnoRemoteControlPort" />
<UnoSourceGeneratorAdditionalProperty Include="UnoRemoteControlHost" />
</ItemGroup>
<!--
Target used to warn the developer that overriden package binaries have been placed in the nuget cache.
-->
<Target Name="_UnoNotifyNugetOverride" BeforeTargets="PrepareProjectReferences">
<ItemGroup>
<!--
If System.* files are present, the package may have been overriden by an Uno.UI solution
version before the introduction of this check.
-->
<_OverrideFiles Include="$(MSBuildThisFileDirectory)../../tools/System*.dll"/>
</ItemGroup>
<PropertyGroup>
<_warnForUnoOverride>false</_warnForUnoOverride>
<_warnForUnoOverride Condition="'@(_OverrideFiles)'!='' or exists('$(MSBuildThisFileDirectory)../../.packageoverride')">true</_warnForUnoOverride>
</PropertyGroup>
<Warning Condition="$(_warnForUnoOverride)"
Text="======================================"
ContinueOnError="true" />
<Warning Condition="$(_warnForUnoOverride)"
Text="The Uno.UI nuget package has been overriden and may use modified files.&#x0d;&#x0a;Clear this package version folder in the nuget cache to return to a stable state."
ContinueOnError="true" />
<Warning Condition="$(_warnForUnoOverride)"
Text="======================================"
ContinueOnError="true" />
</Target>
</Project>