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

124 строки
4.7 KiB
XML

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.XamlGTask" AssemblyFile="$(MSBuildThisFileDirectory)Xamarin.Forms.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.CssGTask" AssemblyFile="$(MSBuildThisFileDirectory)Xamarin.Forms.Build.Tasks.dll"/>
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.XamlCTask" AssemblyFile="$(MSBuildThisFileDirectory)Xamarin.Forms.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Forms.Build.Tasks.GetTasksAbi" AssemblyFile="$(MSBuildThisFileDirectory)Xamarin.Forms.Build.Tasks.dll" />
<PropertyGroup>
<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
Text="Xamarin.Forms targets have been imported multiple times. Please check your project file and remove the duplicate import(s)."
Code="XF001"
Condition="'$(_XFTargetsImportedAgain)' == 'True'" />
<GetTasksAbi>
<Output TaskParameter="AbiVersion" PropertyName="_XFTasksAbi" />
</GetTasksAbi >
<PropertyGroup>
<_XFTasksExpectedAbi>4</_XFTasksExpectedAbi>
</PropertyGroup>
<Error
Text="Xamarin.Forms tasks do not match targets. Please ensure that all projects reference the same version of Xamarin.Forms, and if the error persists, please restart the IDE."
Code="XF002"
Condition="'$(_XFTasksAbi)' != '$(_XFTasksExpectedAbi)'" />
</Target>
<Target Name="_ValidateMSBuild" BeforeTargets="_CheckForInvalidConfigurationAndPlatform">
<Error
Text="Xamarin.Forms require msbuild. xbuild is no longer supported."
Code="XF003"
Condition="'$(IsXBuild)' == 'true'" />
</Target>
<!-- XamlG -->
<Target Name="UpdateDesignTimeXaml" DependsOnTargets="XamlG"/>
<PropertyGroup>
<CoreCompileDependsOn>
XamlG;
$(CoreCompileDependsOn);
</CoreCompileDependsOn>
</PropertyGroup>
<Target Name="XamlG" BeforeTargets="BeforeCompile" Condition="'$(_XamlGAlreadyExecuted)'!='true'">
<PropertyGroup>
<_XamlGAlreadyExecuted>true</_XamlGAlreadyExecuted>
</PropertyGroup>
<XamlGTask
XamlFiles="@(EmbeddedResource)" Condition="'%(Extension)' == '.xaml' AND '$(DefaultLanguageSourceExtension)' == '.cs'"
Language = "$(Language)"
AssemblyName = "$(AssemblyName)"
OutputPath = "$(IntermediateOutputPath)">
<Output ItemName="FilesWrite" TaskParameter="GeneratedCodeFiles" />
<Output ItemName="Compile" TaskParameter="GeneratedCodeFiles" />
</XamlGTask>
</Target>
<!-- XamlC -->
<PropertyGroup>
<XFVerbosity Condition="'$(XFVerbosity)' == ''">2</XFVerbosity>
<CompileDependsOn>
$(CompileDependsOn);
XamlC;
</CompileDependsOn>
</PropertyGroup>
<Target Name="XamlC" AfterTargets="AfterCompile" Condition="'$(_XamlCAlreadyExecuted)'!='true'">
<PropertyGroup>
<_XamlCAlreadyExecuted>true</_XamlCAlreadyExecuted>
</PropertyGroup>
<XamlCTask
Assembly = "$(IntermediateOutputPath)$(TargetFileName)"
ReferencePath = "@(ReferencePath)"
Verbosity = "$(XFVerbosity)"
OptimizeIL = "true"
DebugSymbols = "$(DebugSymbols)"
DebugType = "$(DebugType)"
KeepXamlResources = "$(XFKeepXamlResources)" />
</Target>
<!-- CssG -->
<PropertyGroup>
<CoreCompileDependsOn>
CssG;
$(CoreCompileDependsOn);
</CoreCompileDependsOn>
</PropertyGroup>
<Target Name="CssG" BeforeTargets="BeforeCompile" Condition="'$(_CssGAlreadyExecuted)'!='true'">
<PropertyGroup>
<_CssGAlreadyExecuted>true</_CssGAlreadyExecuted>
</PropertyGroup>
<CssGTask
XamlFiles="@(EmbeddedResource)" Condition="'%(Extension)' == '.css' AND '$(DefaultLanguageSourceExtension)' == '.cs'"
Language = "$(Language)"
AssemblyName = "$(AssemblyName)"
OutputPath = "$(IntermediateOutputPath)">
<Output ItemName="FilesWrite" TaskParameter="GeneratedCodeFiles" />
<Output ItemName="Compile" TaskParameter="GeneratedCodeFiles" />
</CssGTask>
</Target>
</Project>