maui-linux/.nuspec/Xamarin.Forms.targets

179 строки
7.1 KiB
XML

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_XFBuildTasksLocation Condition="'$(_XFBuildTasksLocation)' == '' AND '$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)netstandard2.0\</_XFBuildTasksLocation>
<_XFBuildTasksLocation Condition="'$(_XFBuildTasksLocation)' == ''">$(MSBuildThisFileDirectory)net46\</_XFBuildTasksLocation>
</PropertyGroup>
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.XamlGTask" AssemblyFile="$(_XFBuildTasksLocation)Xamarin.Forms.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.CssGTask" AssemblyFile="$(_XFBuildTasksLocation)Xamarin.Forms.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.XamlCTask" AssemblyFile="$(_XFBuildTasksLocation)Xamarin.Forms.Build.Tasks.dll" />
<PropertyGroup>
<SynthesizeLinkMetadata>true</SynthesizeLinkMetadata>
<EnableDefaultXamlItems Condition="'$(EnableDefaultXamlItems)'==''">True</EnableDefaultXamlItems>
<_DefaultXamlItemsEnabled>False</_DefaultXamlItemsEnabled>
<EnableDefaultCssItems Condition="'$(EnableDefaultCssItems)'==''">True</EnableDefaultCssItems>
<_DefaultCssItemsEnabled>False</_DefaultCssItemsEnabled>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Forms.DefaultItems.targets" Condition="'$(MSBuildSDKsPath)'!=''" />
<ItemGroup>
<ProjectCapability Include="XamarinForms" />
</ItemGroup>
<!-- Check Tasks ABI and other validations -->
<PropertyGroup>
<_XFTargetsImportedAgain Condition="'$(_XFTargetsImported)'=='True'">True</_XFTargetsImportedAgain>
<_XFTargetsImported>True</_XFTargetsImported>
<IsXBuild Condition="'$(MSBuildRuntimeType)' == ''">true</IsXBuild>
<IsXBuild Condition="'$(MSBuildRuntimeType)' != ''">false</IsXBuild>
</PropertyGroup>
<Target Name="_ValidateXFTasks" BeforeTargets="_CheckForInvalidConfigurationAndPlatform" Condition="'$(XFDisableTargetsValidation)' != 'True'">
<Error Code="XF001"
Text="Xamarin.Forms targets have been imported multiple times. Please check your project file and remove the duplicate import(s)."
Condition="'$(_XFTargetsImportedAgain)' == 'True'" />
</Target>
<Target Name="_ValidateMSBuild" BeforeTargets="_CheckForInvalidConfigurationAndPlatform">
<Error Code="XF003"
Text="Xamarin.Forms require msbuild. xbuild is no longer supported."
Condition="'$(IsXBuild)' == 'true'" />
</Target>
<Target Name="_ValidateNETFrameworkVersion"
BeforeTargets="_CheckForInvalidConfigurationAndPlatform"
Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' AND '$(TargetFrameworkVersion.Substring(1))' &lt; '4.6.1' AND '$(XFDisableFrameworkVersionValidation)' != 'True'">
<Error Code="XF004"
Text="XF requires .NETFramework >= v4.6.1. You have '$(TargetFrameworkVersion)'" />
</Target>
<!-- XamlG -->
<Target
Name="UpdateDesignTimeXaml"
DependsOnTargets="XamlG"/>
<PropertyGroup>
<CoreCompileDependsOn>
XamlG;
$(CoreCompileDependsOn);
</CoreCompileDependsOn>
</PropertyGroup>
<Target
Name="_FindXamlGFiles"
DependsOnTargets="PrepareResourceNames">
<ItemGroup>
<_XamlGInputs
Include="@(EmbeddedResource)"
Condition="'%(Extension)' == '.xaml' AND '$(DefaultLanguageSourceExtension)' == '.cs' AND '%(TargetPath)' != ''" />
<_XamlGOutputs
Include="@(_XamlGInputs->'$(IntermediateOutputPath)%(TargetPath).g.cs')" />
</ItemGroup>
</Target>
<Target
Name="XamlG"
BeforeTargets="BeforeCompile"
DependsOnTargets="_FindXamlGFiles; PrepareResourceNames; AfterResolveReferences"
Inputs="@(_XamlGInputs)"
Outputs="@(_XamlGOutputs)">
<PropertyGroup>
<ReferencedAssemblies>@(ReferencePath)</ReferencedAssemblies>
</PropertyGroup>
<XamlGTask
XamlFiles="@(_XamlGInputs)"
OutputFiles="@(_XamlGOutputs)"
Language="$(Language)"
References = "$(ReferencedAssemblies)"
AssemblyName="$(AssemblyName)" />
<ItemGroup>
<FileWrites Include="@(_XamlGOutputs)" />
<Compile Include="@(_XamlGOutputs)" />
</ItemGroup>
</Target>
<!-- XamlC -->
<PropertyGroup>
<CompileDependsOn>
$(CompileDependsOn);
XamlC;
</CompileDependsOn>
</PropertyGroup>
<Target Name="XamlC" AfterTargets="AfterCompile" Inputs="$(IntermediateOutputPath)$(TargetFileName)" Outputs="$(IntermediateOutputPath)XamlC.stamp" Condition=" '$(DesignTimeBuild)' != 'True' ">
<XamlCTask
Assembly = "$(IntermediateOutputPath)$(TargetFileName)"
ReferencePath = "@(ReferencePath)"
OptimizeIL = "true"
DebugSymbols = "$(DebugSymbols)"
DebugType = "$(DebugType)"
KeepXamlResources = "$(XFKeepXamlResources)" />
<Touch Files="$(IntermediateOutputPath)XamlC.stamp" AlwaysCreate="True" />
<ItemGroup>
<FileWrites Include="$(IntermediateOutputPath)XamlC.stamp" />
</ItemGroup>
</Target>
<!-- CssG -->
<PropertyGroup>
<CoreCompileDependsOn>
CssG;
$(CoreCompileDependsOn);
</CoreCompileDependsOn>
</PropertyGroup>
<Target Name="_FindCSSFiles" DependsOnTargets="PrepareResourceNames">
<ItemGroup>
<_CSSInputs Include="@(EmbeddedResource)" Condition="'%(Extension)' == '.css' AND '$(DefaultLanguageSourceExtension)' == '.cs' AND '%(TargetPath)' != ''" />
<_CSSOutputs Include="@(_CSSInputs->'$(IntermediateOutputPath)%(TargetPath).g.cs')" />
</ItemGroup>
</Target>
<Target Name="CssG" BeforeTargets="BeforeCompile" DependsOnTargets="_FindCSSFiles" Inputs="@(_CSSInputs)" Outputs="@(_CSSOutputs)">
<CssGTask
CSSFiles="@(_CSSInputs)"
OutputFiles="@(_CSSOutputs)"
Language = "$(Language)"
AssemblyName = "$(AssemblyName)" />
<ItemGroup>
<FileWrites Include="@(_CSSOutputs)" />
<Compile Include="@(_CSSOutputs)" />
</ItemGroup>
</Target>
<!--
Platform Specific Targets.
We can't use a framework specific targets file because it breaks shared projects i.e. /build/MonoAndroid10/Xamarin.Forms.targets
-->
<!-- MonoAndroid targets. -->
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid'">
<CoreCompileDependsOn>
IncludeProguardForAndroid;
$(CoreCompileDependsOn);
</CoreCompileDependsOn>
<PrepareForBuildDependsOn>
ValidateTargetFrameworkVersionForForms;
$(PrepareForBuildDependsOn);
</PrepareForBuildDependsOn>
</PropertyGroup>
<Target Name="IncludeProguardForAndroid" Condition="'$(XFDisableDefaultProguardConfiguration)' != 'True'">
<ItemGroup>
<ProguardConfiguration Include="$(MSBuildThisFileDirectory)MonoAndroid10\proguard.cfg" />
</ItemGroup>
</Target>
<Target Name="ValidateTargetFrameworkVersionForForms" Condition="'$(XFDisableTargetFrameworkValidation)' != 'True'">
<PropertyGroup>
<MinTargetFrameworkVersionForForms>8.1</MinTargetFrameworkVersionForForms>
<TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion.TrimStart('vV'))</TargetFrameworkVersionWithoutV>
</PropertyGroup>
<Error Code="XF005" Condition="$(TargetFrameworkVersionWithoutV) &lt; $(MinTargetFrameworkVersionForForms)"
Text="The %24(TargetFrameworkVersion) for $(ProjectName) ($(TargetFrameworkVersion)) is less than the minimum required %24(TargetFrameworkVersion) for Xamarin.Forms ($(MinTargetFrameworkVersionForForms)). You need to increase the %24(TargetFrameworkVersion) for $(ProjectName)." />
</Target>
</Project>