2016-04-21 16:40:25 +03:00
|
|
|
<!--
|
|
|
|
***********************************************************************************************
|
|
|
|
Xamarin.Mac.ObjCBinding.Common.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 xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Mac.ObjCBinding.Common.props"
|
2018-03-21 22:27:53 +03:00
|
|
|
Condition="'$(_XamarinCommonBindingPropsHasBeenImported)' != 'true'" />
|
2016-04-21 16:40:25 +03:00
|
|
|
|
|
|
|
<Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets"
|
|
|
|
Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')"/>
|
|
|
|
|
2019-12-16 21:05:40 +03:00
|
|
|
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Mac.msbuild.targets"/>
|
2016-04-21 16:40:25 +03:00
|
|
|
|
|
|
|
<!-- Add our own pre-build steps -->
|
2020-05-26 15:23:48 +03:00
|
|
|
<PropertyGroup Condition="'$(_UsingXamarinSdk)' != 'true'">
|
2016-04-21 16:40:25 +03:00
|
|
|
<BuildDependsOn>
|
[msbuild] Ensure that `BuildOnlySettings` is the first target to run for a `Build` (#841)
When building the `inspector` project with msbuild, the build fails
because of a missing `System.Runtime` reference,
-> which can be traced to the `ResolveAssemblyReferences` task not resolving dependencies.
-> which can be traced to `$(_FindDependencies)` property being set to false
-> which is false, because `$(BuildingProject)` is false, which should
have been set by the `BuildOnlySettings` target, run as a dependency of
`CoreBuild`.
We override `$(BuildDependsOn)` as:
<BuildDependsOn>
...
_UnpackLibraryResources;
$(BuildDependsOn);
...
</BuildDependsOn>
.. so, `_UnpackLibraryResources` runs before `BuildOnlySettings`. And
`_UnpackLibraryResources` depends on `ResolveReferences`, so the
`ResolveAssemblyReferences` task runs with the incorrect properties. And
later, during the build when `ResolveAssemblyReferences` is invoked
again, it gets skipped and the incorrect outputs get used.
`$(BuildingProject)` should be true for a project build. So,
`Xamarin.Mac.Common.targets` are fixed for that. And other similar
target files are also fixed.
Note: `Xamarin.iOS.Common.targets` already does this correctly.
Note: `$(BuildingProject)` is not used in xbuild, so this bug is seen
only when building with msbuild.
2016-09-16 04:38:55 +03:00
|
|
|
BuildOnlySettings;
|
2016-04-21 16:40:25 +03:00
|
|
|
_CreateGeneratedSourcesDir;
|
|
|
|
_CreateEmbeddedResources;
|
|
|
|
$(BuildDependsOn)
|
|
|
|
</BuildDependsOn>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!-- Add our own Clean steps -->
|
2020-05-26 15:23:48 +03:00
|
|
|
<PropertyGroup Condition="'$(_UsingXamarinSdk)' != 'true'">
|
2016-04-21 16:40:25 +03:00
|
|
|
<CleanDependsOn>
|
|
|
|
_CleanGeneratedSources;
|
|
|
|
$(CleanDependsOn)
|
|
|
|
</CleanDependsOn>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!-- Create a directory to contain the generated sources -->
|
|
|
|
<Target Name="_CreateGeneratedSourcesDir">
|
|
|
|
<MakeDir Directories="$(GeneratedSourcesDir)" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<!-- Clean the generated sources -->
|
|
|
|
<Target Name="_CleanGeneratedSources">
|
|
|
|
<RemoveDir Directories="$(GeneratedSourcesDir)" Condition="Exists ('$(GeneratedSourcesDir)')" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="_AssignBundleResourceNames">
|
2020-06-02 17:41:44 +03:00
|
|
|
<AssignBundleResourceNames BundleResources="@(BundleResource)" ResourceDirectoryPrefixes="$(_ResourcePrefix)">
|
2016-04-21 16:40:25 +03:00
|
|
|
<Output ItemName="_BundleResourceWithName" TaskParameter="BundleResourcesWithNames" />
|
|
|
|
</AssignBundleResourceNames>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="_CreateEmbeddedResources" DependsOnTargets="_CollectBundleResources">
|
|
|
|
<CreateEmbeddedResources BundleResources="@(_BundleResourceWithLogicalName)" Prefix="xammac">
|
|
|
|
<Output ItemName="EmbeddedResource" TaskParameter="EmbeddedResources" />
|
|
|
|
</CreateEmbeddedResources>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets"
|
|
|
|
Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')"/>
|
[msbuild] Ensure that `BuildOnlySettings` is the first target to run for a `Build` (#841)
When building the `inspector` project with msbuild, the build fails
because of a missing `System.Runtime` reference,
-> which can be traced to the `ResolveAssemblyReferences` task not resolving dependencies.
-> which can be traced to `$(_FindDependencies)` property being set to false
-> which is false, because `$(BuildingProject)` is false, which should
have been set by the `BuildOnlySettings` target, run as a dependency of
`CoreBuild`.
We override `$(BuildDependsOn)` as:
<BuildDependsOn>
...
_UnpackLibraryResources;
$(BuildDependsOn);
...
</BuildDependsOn>
.. so, `_UnpackLibraryResources` runs before `BuildOnlySettings`. And
`_UnpackLibraryResources` depends on `ResolveReferences`, so the
`ResolveAssemblyReferences` task runs with the incorrect properties. And
later, during the build when `ResolveAssemblyReferences` is invoked
again, it gets skipped and the incorrect outputs get used.
`$(BuildingProject)` should be true for a project build. So,
`Xamarin.Mac.Common.targets` are fixed for that. And other similar
target files are also fixed.
Note: `Xamarin.iOS.Common.targets` already does this correctly.
Note: `$(BuildingProject)` is not used in xbuild, so this bug is seen
only when building with msbuild.
2016-09-16 04:38:55 +03:00
|
|
|
</Project>
|