-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Microsoft.NET.Sdk.FSharpTargetsShim.targets
63 lines (53 loc) · 4.67 KB
/
Microsoft.NET.Sdk.FSharpTargetsShim.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!--
***********************************************************************************************
Microsoft.NET.Sdk.FSharpTargetsShim.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.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildToolsPath)\Microsoft.Managed.Before.targets" />
<PropertyGroup Condition=" '$(UseBundledFSharpTargets)' == 'true' ">
<AppDesignerFolder Condition="'$(AppDesignerFolder)' == ''">Properties</AppDesignerFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(DisableImplicitConfigurationDefines)' != 'true' and '$(UseBundledFSharpTargets)' == 'true' ">
<ImplicitConfigurationDefine>$(Configuration.ToUpperInvariant())</ImplicitConfigurationDefine>
<!-- Replace dashes and periods in the configuration with underscores. This makes it more likely that
the resulting compilation constant will be a valid C# conditional compilation symbol. As the set
of characters that aren't allowed is essentially open-ended, there's probably not a good way to
fully sanitize the Configuration in MSBuild evaluation. If the resulting string still isn't a
valid conditional combilation symbol, then the compiler will generate the following error and
the define will be ignored:
warning MSB3052: The parameter to the compiler is invalid, '/define:0BAD_DEFINE' will be ignored.
-->
<ImplicitConfigurationDefine>$(ImplicitConfigurationDefine.Replace('-', '_'))</ImplicitConfigurationDefine>
<ImplicitConfigurationDefine>$(ImplicitConfigurationDefine.Replace('.', '_'))</ImplicitConfigurationDefine>
<DefineConstants>$(DefineConstants);$(ImplicitConfigurationDefine)</DefineConstants>
</PropertyGroup>
<!-- ***************************************************************************************************************
Loads the cross-targeting targets if we are doing a cross-targeting build
Import design time targets for Roslyn Project System. These are only available if Visual Studio is installed.
Import design time targets before the common crosstargeting targets, which import targets from Nuget.
*************************************************************************************************************** -->
<PropertyGroup>
<FSharpDesignTimeTargetsPath Condition="'$(FSharpDesignTimeTargetsPath)' == ''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.FSharp.DesignTime.targets</FSharpDesignTimeTargetsPath>
</PropertyGroup>
<Import Project="$(FSharpDesignTimeTargetsPath)"
Condition=" '$(UseBundledFSharpTargets)' == 'true' and '$(FSharpDesignTimeTargetsPath)' != '' and Exists('$(FSharpDesignTimeTargetsPath)') " />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.CrossTargeting.targets"
Condition=" '$(UseBundledFSharpTargets)' == 'true' and '$(IsCrossTargetingBuild)' == 'true' "/>
<!-- ***************************************************************************************************************
Shim to select the correct Microsoft.NET.Sdk.FSharp.targets file when not running
under Cross-targeting build and not under FSharp.Sdk
If running under desktop select Microsoft.FSharp.targets file from VS deployment,
if running core msbuild select Microsoft.FSharp.targets from dotnet cli deployment
*************************************************************************************************************** -->
<PropertyGroup Condition=" '$(IsCrossTargetingBuild)' != 'true' " >
<FSharpTargetsShim Condition = " '$(FSharpTargetsShim)' == '' and Exists('$(MSBuildToolsPath)\FSharp\Microsoft.FSharp.NetSdk.targets') ">$(MSBuildToolsPath)\FSharp\Microsoft.FSharp.NetSdk.targets</FSharpTargetsShim>
<FSharpTargetsShim Condition = " '$(FSharpTargetsShim)' == '' and Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.NetSdk.targets') ">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.NetSdk.targets</FSharpTargetsShim>
</PropertyGroup>
<Import Condition=" '$(UseBundledFSharpTargets)' == 'true' and '$(IsCrossTargetingBuild)' != 'true' and Exists('$(FSharpTargetsShim)') " Project="$(FSharpTargetsShim)" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Managed.After.targets" />
</Project>