This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze.foodcritic.msbuild
56 lines (47 loc) · 2.82 KB
/
analyze.foodcritic.msbuild
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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
DefaultTargets="Analyze_Foodcritic_Run"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Defines whether the current script file has been loaded / imported or not -->
<ExistsAnalyzeFoodcritic>true</ExistsAnalyzeFoodcritic>
<!-- The full path to the settings file that contains all the settings for the build process -->
<BuildPropertyFile Condition=" '$(BuildPropertyFile)' == '' ">UNDEFINED</BuildPropertyFile>
<!--
Define the DirWorkspace before importing the BuildPropertyFile so that it is defined and can be used by
the properties in the BuildPropertyFile. Note that we can't define it in the BuildPropertyFile because that
is imported which means there is no way to get the path of the file.
-->
<DirWorkspace Condition=" '$(DirWorkspace)' == '' ">$([System.IO.Path]::GetDirectoryName('$(BuildPropertyFile)'))</DirWorkspace>
</PropertyGroup>
<Import Project="$(BuildPropertyFile)"
Condition="Exists('$(BuildPropertyFile)') AND '$(ExistsSettings)' != 'true' " />
<PropertyGroup>
<!-- External tools -->
<ToolsExternalFoodCritic Condition=" '$(ToolsExternalFoodCritic)' == '' ">foodcritic</ToolsExternalFoodCritic>
</PropertyGroup>
<Target Name="Analyze_Foodcritic_Run"
DependsOnTargets="_Analyze_Foodcritic_DisplayInfo">
<CallTarget Targets="_Analyze_Foodcritic_Execute" />
</Target>
<!-- Display info -->
<Target Name="_Analyze_Foodcritic_DisplayInfo"
DependsOnTargets="_Analyze_Foodcritic_DebugLog">
<Message Text="Running foodcritic on the chef cookbooks ..." />
</Target>
<Target Name="_Analyze_Foodcritic_DebugLog"
Condition="$(ShouldDisplayDebugLog)">
<Message Text="Project directory structure:" />
<Message Text="The workspace is located at: $(DirWorkspace)" />
<Message Text="The directory containing the build output is located at: $(DirBuild)" />
<Message Text="The directory containing the build logs is located at: $(DirBuildLogs)" />
<Message Text="The directory containing the temporary build files is located at: $(DirBuildTemp)" />
<Message Text="The directory containing the chef cookbooks is located at: $(DirBuildTempMobilePortalCookbooks)" />
<Message Text=" " />
<Message Text="Foodcritic command line executable is located at: $(ToolsExternalFoodCritic)" />
<Message Text=" " />
</Target>
<Target Name="_Analyze_Foodcritic_Execute">
<Exec Command="$(ToolsExternalFoodCritic) -f any "$(DirBuildTempMobilePortalCookbooks)"" />
</Target>
</Project>