2016-04-21 16:40:25 +03:00
|
|
|
<!--
|
|
|
|
***********************************************************************************************
|
|
|
|
Xamarin.Mac.ObjcBinding.CSharp.targets
|
|
|
|
|
|
|
|
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
|
|
|
|
created a backup copy. Incorrect changes to this file will make it
|
|
|
|
impossible to load or build your projects from the command-line or the IDE.
|
|
|
|
|
|
|
|
This file imports the version- and platform-specific targets for the project importing
|
|
|
|
this file. This file also defines targets to produce an error if the specified targets
|
|
|
|
file does not exist, but the project is built anyway (command-line or IDE build).
|
|
|
|
|
|
|
|
Copyright (C) 2014 Xamarin Inc. All rights reserved.
|
|
|
|
***********************************************************************************************
|
|
|
|
-->
|
|
|
|
|
|
|
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<UsingTask TaskName="Xamarin.Mac.Tasks.BTouch" AssemblyFile="Xamarin.Mac.Tasks.dll" />
|
2018-12-12 17:55:57 +03:00
|
|
|
<UsingTask TaskName="Xamarin.Mac.Tasks.CreateBindingResourcePackage" AssemblyFile="Xamarin.Mac.Tasks.dll" />
|
2018-01-08 22:29:52 +03:00
|
|
|
<UsingTask TaskName="Xamarin.MacDev.Tasks.Zip" AssemblyFile="Xamarin.Mac.Tasks.dll" />
|
2016-04-21 16:40:25 +03:00
|
|
|
<UsingTask TaskName="Xamarin.Mac.Tasks.PrepareNativeReferences" AssemblyFile="Xamarin.Mac.Tasks.dll" />
|
|
|
|
|
2018-01-08 22:29:52 +03:00
|
|
|
<UsingTask TaskName="Microsoft.Build.Tasks.Delete" AssemblyFile="Xamarin.Mac.Tasks.dll"/>
|
2017-10-09 23:41:37 +03:00
|
|
|
|
2016-04-21 16:40:25 +03:00
|
|
|
<Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets"
|
|
|
|
Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')"/>
|
2018-03-21 22:27:53 +03:00
|
|
|
|
|
|
|
<!-- Due to IDE/template bugs, many bindings projects exist in the wild withtout correct TFI/TFV tags.
|
|
|
|
In addition, System is not supported, so treat System as Modern or Full, depending on TFV being set.
|
|
|
|
Microsoft.CSharp.targets gives TargetFrameworkVersion / TargetFrameworkIdentifier default values, so we _must_ do this _before_
|
|
|
|
import Microsoft.CSharp.targets. However, we can't do most of Xamarin.Mac.ObjCBinding.CSharp.props before it. -->
|
|
|
|
|
|
|
|
<Choose>
|
|
|
|
<When Condition=" '$(UseXamMacFullFramework)' == '' And ( '$(TargetFrameworkVersion)' == 'v2.0' Or '$(TargetFrameworkVersion)' == '' )">
|
|
|
|
<PropertyGroup>
|
|
|
|
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
|
|
|
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
|
|
|
|
</PropertyGroup>
|
|
|
|
</When>
|
|
|
|
<Otherwise>
|
|
|
|
<PropertyGroup>
|
|
|
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
|
|
<UseXamMacFullFramework>true</UseXamMacFullFramework>
|
|
|
|
<TargetFrameworkIdentifier></TargetFrameworkIdentifier>
|
|
|
|
</PropertyGroup>
|
|
|
|
</Otherwise>
|
|
|
|
</Choose>
|
2016-04-21 16:40:25 +03:00
|
|
|
|
2018-10-11 03:14:31 +03:00
|
|
|
<PropertyGroup>
|
|
|
|
<!-- Enable nuget package conflict resolution -->
|
|
|
|
<ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
2020-05-26 14:39:37 +03:00
|
|
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" Condition="'$(_UsingXamarinSdk)' != 'true'" />
|
2018-03-21 22:27:53 +03:00
|
|
|
|
|
|
|
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Mac.ObjCBinding.CSharp.props"/>
|
2017-03-14 19:08:04 +03:00
|
|
|
|
2018-03-21 22:27:53 +03:00
|
|
|
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Mac.ObjCBinding.Common.targets" />
|
2018-03-13 12:38:14 +03:00
|
|
|
|
2018-12-12 17:55:57 +03:00
|
|
|
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Shared.targets" />
|
|
|
|
|
2018-03-13 12:38:14 +03:00
|
|
|
<PropertyGroup>
|
2018-03-21 22:27:53 +03:00
|
|
|
<_GeneratedSourcesFileList>$(GeneratedSourcesDir)sources.list</_GeneratedSourcesFileList>
|
2020-04-15 22:41:32 +03:00
|
|
|
<LangVersion>latest</LangVersion>
|
2016-04-21 16:40:25 +03:00
|
|
|
|
2018-12-12 17:55:57 +03:00
|
|
|
<!-- Add our own pre and post build steps -->
|
2016-04-21 16:40:25 +03:00
|
|
|
<CompileDependsOn>
|
|
|
|
_GenerateBindings;
|
|
|
|
_PrepareNativeReferences;
|
|
|
|
_CollectGeneratedSources;
|
|
|
|
$(CompileDependsOn)
|
2018-12-12 17:55:57 +03:00
|
|
|
_CreateBindingResourcePackage;
|
2016-04-21 16:40:25 +03:00
|
|
|
</CompileDependsOn>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!-- Override the CoreCompile Target to use btouch -->
|
|
|
|
<Target Name="_GenerateBindings"
|
2020-04-06 13:47:01 +03:00
|
|
|
DependsOnTargets="_ComputeTargetFrameworkMoniker"
|
2016-04-21 16:40:25 +03:00
|
|
|
Inputs="$(MSBuildAllProjects);@(ObjcBindingApiDefinition);@(ObjcBindingCoreSource);@(ReferencePath);@(ObjcBindingNativeLibrary)"
|
2017-09-07 23:31:43 +03:00
|
|
|
Outputs="$(_GeneratedSourcesFileList)"
|
|
|
|
Condition="'$(DesignTimeBuild)' != 'true'">
|
2016-04-21 16:40:25 +03:00
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<BTouchReferencePath Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)' == '.dll'" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<BTouchEmitDebugInformation>false</BTouchEmitDebugInformation>
|
|
|
|
<BTouchEmitDebugInformation Condition="'$(Debug)' != ''">true</BTouchEmitDebugInformation>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<Message Text="BTouchEmitDebugInformation: $(BTouchEmitDebugInformation)"/>
|
|
|
|
|
|
|
|
<BTouch
|
2018-04-14 01:21:05 +03:00
|
|
|
Condition="'$(IsMacEnabled)' == 'true'"
|
2018-03-21 22:27:53 +03:00
|
|
|
SessionId="$(BuildSessionId)"
|
|
|
|
OutputPath="$(OutputPath)"
|
|
|
|
ObjectiveCLibraries="@(ObjcBindingNativeLibrary)"
|
2016-04-21 16:40:25 +03:00
|
|
|
AdditionalLibPaths="$(AdditionalLibPaths)"
|
|
|
|
AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
|
|
|
|
ApiDefinitions="@(ObjcBindingApiDefinition)"
|
|
|
|
BaseLibDll="$(BaseLibDllPath)"
|
|
|
|
CoreSources="@(ObjcBindingCoreSource)"
|
|
|
|
DefineConstants="$(DefineConstants)"
|
2016-07-11 20:56:04 +03:00
|
|
|
EmitDebugInformation="$(BTouchEmitDebugInformation)"
|
2017-04-10 09:14:42 +03:00
|
|
|
ExtraArgs="$(BTouchExtraArgs)"
|
2016-04-21 16:40:25 +03:00
|
|
|
GeneratedSourcesDir="$(GeneratedSourcesDir)"
|
|
|
|
GeneratedSourcesFileList="$(_GeneratedSourcesFileList)"
|
|
|
|
Namespace="$(Namespace)"
|
|
|
|
OutputAssembly="$(OutputAssembly)"
|
2017-01-26 19:24:14 +03:00
|
|
|
ProcessEnums="$(ProcessEnums)"
|
2017-04-10 09:14:42 +03:00
|
|
|
ProjectDir="$(MSBuildProjectDirectory)"
|
2016-04-21 16:40:25 +03:00
|
|
|
References="@(ReferencePath);@(BTouchReferencePath)"
|
2020-03-06 20:28:58 +03:00
|
|
|
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
|
2016-04-21 16:40:25 +03:00
|
|
|
BTouchToolPath="$(BTouchToolPath)"
|
2019-10-26 00:44:35 +03:00
|
|
|
BTouchToolExe="$(BTouchToolExe)"
|
|
|
|
StandardOutputImportance="High"
|
|
|
|
>
|
2016-04-21 16:40:25 +03:00
|
|
|
</BTouch>
|
|
|
|
</Target>
|
|
|
|
|
2017-09-07 23:31:43 +03:00
|
|
|
<Target Name="_PrepareNativeReferences" Condition="'$(DesignTimeBuild)' != 'true'">
|
2016-04-21 16:40:25 +03:00
|
|
|
<PrepareNativeReferences
|
2018-04-14 01:21:05 +03:00
|
|
|
Condition="'$(IsMacEnabled)' == 'true'"
|
2016-04-21 16:40:25 +03:00
|
|
|
SessionId="$(BuildSessionId)"
|
|
|
|
IntermediateOutputPath="$(IntermediateOutputPath)"
|
|
|
|
NativeReferences="@(NativeReference)"
|
|
|
|
>
|
2018-12-12 17:55:57 +03:00
|
|
|
<Output ItemName="ManifestResourceWithNoCulture" TaskParameter="EmbeddedResources" Condition="'$(NoBindingEmbedding)' != 'true'"/>
|
|
|
|
<Output ItemName="_NativeFramework" TaskParameter="NativeFrameworks" Condition="'$(NoBindingEmbedding)' != 'true'"/>
|
2016-04-21 16:40:25 +03:00
|
|
|
<Output ItemName="Compile" TaskParameter="LinkWithAttributes" />
|
|
|
|
</PrepareNativeReferences>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="_CollectNativeFrameworkResources" Returns="@(_NativeFrameworkResource)" DependsOnTargets="_PrepareNativeReferences">
|
|
|
|
<CreateItem Include="@(_NativeFramework -> '%(Identity)\**\*.*')">
|
|
|
|
<Output ItemName="_NativeFrameworkResource" TaskParameter="Include" />
|
|
|
|
</CreateItem>
|
|
|
|
</Target>
|
|
|
|
|
2017-10-09 23:41:37 +03:00
|
|
|
<Target Name="_CompressFrameworks" Inputs="@(_NativeFrameworkResource)" Outputs="$(IntermediateOutputPath)%(_NativeFramework.Filename)%(_NativeFramework.Extension)" DependsOnTargets="_CollectNativeFrameworkResources">
|
2018-04-14 01:21:05 +03:00
|
|
|
<Delete SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' == 'true'" Files="$(IntermediateOutputPath)%(_NativeFramework.Filename)%(_NativeFramework.Extension)" />
|
2017-10-09 23:41:37 +03:00
|
|
|
|
2016-04-21 16:40:25 +03:00
|
|
|
<Zip
|
2018-04-14 01:21:05 +03:00
|
|
|
Condition="'$(IsMacEnabled)' == 'true'"
|
2016-04-21 16:40:25 +03:00
|
|
|
SessionId="$(BuildSessionId)"
|
|
|
|
ToolExe="$(ZipExe)"
|
|
|
|
ToolPath="$(ZipPath)"
|
|
|
|
Recursive="true"
|
|
|
|
Symlinks="true"
|
|
|
|
Sources="%(_NativeFramework.Identity)"
|
|
|
|
OutputFile="$(IntermediateOutputPath)%(_NativeFramework.Filename)%(_NativeFramework.Extension)"
|
|
|
|
WorkingDirectory="%(_NativeFramework.FullPath)" >
|
|
|
|
</Zip>
|
|
|
|
|
|
|
|
<CreateItem Include="$(IntermediateOutputPath)%(_NativeFramework.Filename)%(_NativeFramework.Extension)">
|
|
|
|
<Output TaskParameter="Include" ItemName="ManifestResourceWithNoCulture" />
|
|
|
|
</CreateItem>
|
|
|
|
</Target>
|
|
|
|
|
2017-09-07 23:31:43 +03:00
|
|
|
<Target Name="_CollectGeneratedSources" DependsOnTargets="_CompressFrameworks;_GenerateBindings"
|
|
|
|
Condition="'$(DesignTimeBuild)' != 'true'">
|
|
|
|
|
2016-04-21 16:40:25 +03:00
|
|
|
<ReadLinesFromFile File="$(_GeneratedSourcesFileList)" >
|
|
|
|
<Output TaskParameter="Lines" ItemName="GeneratedSources" />
|
|
|
|
</ReadLinesFromFile>
|
|
|
|
|
|
|
|
<CreateItem Include="@(ObjcBindingCoreSource)">
|
|
|
|
<Output TaskParameter="Include" ItemName="Compile" />
|
|
|
|
</CreateItem>
|
|
|
|
|
|
|
|
<CreateItem Include="@(GeneratedSources)">
|
|
|
|
<Output TaskParameter="Include" ItemName="Compile" />
|
|
|
|
</CreateItem>
|
|
|
|
|
|
|
|
<CreateItem Include="@(ObjcBindingNativeLibrary)">
|
|
|
|
<Output TaskParameter="Include" ItemName="ManifestResourceWithNoCulture" />
|
|
|
|
</CreateItem>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets"
|
|
|
|
Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')"/>
|
|
|
|
</Project>
|