xamarin-android/build-tools/scripts/RequiredPrograms.targets

55 строки
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyFile="$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.DownloadUri" />
<UsingTask AssemblyFile="$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.PrepareInstall" />
<UsingTask AssemblyFile="$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.Which" />
<UsingTask AssemblyFile="$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.GitCommitTime" />
<Target Name="CheckForRequiredPrograms"
Condition=" '@(RequiredProgram)' != '' "
Inputs="@(RequiredProgram)"
Outputs="%(RequiredProgram.Identity)-BATCH">
<Which
HostOS="$(HostOS)"
HostOSName="$(HostOsName)"
Program="@(RequiredProgram)"
Required="False">
<Output TaskParameter="Location" PropertyName="_Location" />
</Which>
<PropertyGroup>
<_ReportError Condition=" '$(_Location)' == '' And '$(AutoProvision)' == 'False' ">True</_ReportError>
<_ReportError Condition=" '$(_ReportError)' == '' ">False</_ReportError>
</PropertyGroup>
<PrepareInstall
Condition=" '$(_Location)' == '' "
HostOS="$(HostOS)"
HostOSName="$(HostOsName)"
Program="@(RequiredProgram)"
UseSudo="$(AutoProvisionUsesSudo)">
<Output TaskParameter="InstallCommand" PropertyName="_InstallCommand" />
<Output TaskParameter="DownloadUrl" ItemName="_DownloadUrl" />
</PrepareInstall>
<Error
Condition=" '$(_ReportError)' == 'True' And '$(_InstallCommand)' == '' "
Text="Could not find required program '%(RequiredProgram.Identity)'."
/>
<Error
ContinueOnError="True"
Condition=" '$(_ReportError)' == 'True' And '@(_DownloadUrl)' != '' "
Text="Please download `%(_DownloadUrl.Url)` into `$(AndroidToolchainCacheDirectory)\%(Filename)%(Extension)`."
/>
<Error
Condition=" '$(_ReportError)' == 'True' And '$(_InstallCommand)' != '' "
Text="Could not find required program '%(RequiredProgram.Identity)'. Please run: $(_InstallCommand)"
/>
<DownloadUri
Condition=" '$(AutoProvision)' == 'True' And '@(_DownloadUrl)' != '' "
SourceUris="%(_DownloadUrl.Url)"
DestinationFiles="@(_DownloadUrl->'$(AndroidToolchainCacheDirectory)\%(Filename)%(Extension)')"
/>
<Exec
Condition=" '$(AutoProvision)' == 'True' And '$(_InstallCommand)' != '' "
Command="$(_InstallCommand)"
/>
</Target>
</Project>