-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
46 lines (41 loc) · 2.28 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
46 lines (41 loc) · 2.28 KB
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
<Project>
<ItemGroup>
<!-- Tell "dotnet watch" to ignore generated files (because changes to them were probably triggered by dotnet watch itself) -->
<Compile Update="**\*.g.fs" Watch="false" />
</ItemGroup>
<!--
Custom target which uses the Adaptify dotnet tool running in local mode.
We use this instead of the Adaptify.MSBuild target for Fable compatibility:
1. the Adaptify.MSBuild target:
a. always runs in server mode
b. works by generating files in the user's temp directory then adding them to the "Compile" itemgroup before
"CoreCompile" runs
2. Fable doesn't run custom targets when building - it just works out which files to build then builds them itself
3. the "addtoproject" option adds generated files directly to the project file, but is only supported in local mode
This target will be called automatically for the .NET build (because we set "BeforeTargets" to "CoreCompile").
Look in ./package.json to see how we call this target when necessary for the Fable build.
-->
<Target
Name="AdaptifyLocal"
BeforeTargets="CoreCompile"
Condition="'$(Adaptifying)' != 'true'"
>
<PropertyGroup>
<!-- When NOT running under NCrunch, use the normal project file path -->
<ProjectFileFullPath Condition="'$(NCRUNCH)' != '1'">$(MSBuildProjectFullPath)</ProjectFileFullPath>
<!--
When running under NCrunch, use the path of the project in its original location rather
than at the location to which NCrunch copies it, because:
1. that means that the version available to Visual Studio will be updated automatically
2. NCrunch will copy the updated version across, so it will still have access to the updated version
-->
<ProjectFileFullPath Condition="'$(NCRUNCH)' == '1'">$(NCrunchOriginalProjectPath)</ProjectFileFullPath>
</PropertyGroup>
<Exec
Command="dotnet adaptify --local --addtoproject $(ProjectFileFullPath)"
EnvironmentVariables="Adaptifying=true"
LogStandardErrorAsError="true"
CustomErrorRegularExpression="(ERRORS|FAILED)"
/>
</Target>
</Project>