|
50 | 50 | </PropertyGroup>
|
51 | 51 |
|
52 | 52 | <PropertyGroup>
|
53 |
| - <_EB_ToolingDir>$([System.IO.Path]::Combine('$(_EB_ScriptBaseDir)','..','tools','$(_EB_PlatformName)'))</_EB_ToolingDir> |
| 53 | + <EpoxyBuildToolingDir>$([System.IO.Path]::Combine('$(_EB_ScriptBaseDir)','..','tools','$(_EB_PlatformName)'))</EpoxyBuildToolingDir> |
54 | 54 | </PropertyGroup>
|
55 | 55 |
|
56 |
| - <!-- ======================== --> |
57 |
| - <!-- Custom task --> |
58 |
| - |
59 |
| - <UsingTask |
60 |
| - TaskName="GetCombinedReferencesBasePath" |
61 |
| - TaskFactory="RoslynCodeTaskFactory" |
62 |
| - AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" > |
63 |
| - <ParameterGroup> |
64 |
| - <References ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" /> |
65 |
| - <CombinedReferencesBasePath Output="true" /> |
66 |
| - </ParameterGroup> |
67 |
| - <Task> |
68 |
| - <Using Namespace="System"/> |
69 |
| - <Using Namespace="System.IO"/> |
70 |
| - <!-- HACK: Will cause compilation error by using `System.Collection.Generic` and/or `System.Linq` on MacOS |
71 |
| - (Maybe related both mono environment and unreferenced core assembly on `RoslynCodeTaskFactory`) --> |
72 |
| - <Using Namespace="System.Collections"/> |
73 |
| - <Using Namespace="Microsoft.Build.Framework"/> |
74 |
| - <Code Type="Fragment" Language="cs"> |
75 |
| -<![CDATA[ |
76 |
| - var candidates = new Hashtable(); |
77 |
| - foreach (var item in References) |
78 |
| - { |
79 |
| - if (!string.IsNullOrEmpty(item.ItemSpec)) |
80 |
| - { |
81 |
| - var path = Path.GetDirectoryName(Path.GetFullPath(item.ItemSpec)); |
82 |
| - candidates[path] = path; |
83 |
| - } |
84 |
| - } |
85 |
| - var pathList = new object[candidates.Keys.Count]; |
86 |
| - candidates.Keys.CopyTo(pathList, 0); |
87 |
| - CombinedReferencesBasePath = string.Join(";", pathList); |
88 |
| -]]> |
89 |
| - </Code> |
90 |
| - </Task> |
91 |
| - </UsingTask> |
92 |
| - |
93 | 56 | <!-- ======================== -->
|
94 | 57 | <!-- Build target -->
|
95 | 58 |
|
96 | 59 | <Target Name="EpoxyBuild" AfterTargets="AfterCompile"
|
97 | 60 | Condition="'$(EpoxyBuildEnable)' == 'True'">
|
98 |
| - |
| 61 | + |
| 62 | + <_EB_CandidateToolingDir ToolingDir="$(EpoxyBuildToolingDir)"> |
| 63 | + <Output TaskParameter="CandidateDir" PropertyName="_EB_ToolingCandidateDir" /> |
| 64 | + </_EB_CandidateToolingDir> |
| 65 | + |
99 | 66 | <PropertyGroup>
|
100 |
| - <EpoxyBuildToolingRuntimeName Condition="'$(EpoxyBuildToolingRuntimeName)' == ''">$(_EB_RuntimeName)</EpoxyBuildToolingRuntimeName> |
101 |
| - <EpoxyBuildToolingDir Condition="'$(EpoxyBuildToolingDir)' == ''">$([System.IO.Path]::GetFullPath('$(_EB_ToolingDir)'))</EpoxyBuildToolingDir> |
102 |
| - <EpoxyBuildToolingPath Condition="'$(EpoxyBuildToolingPath)' == ''">$([System.IO.Path]::Combine('$(EpoxyBuildToolingDir)','$(_EB_ExecutableName)'))</EpoxyBuildToolingPath> |
103 |
| - <EpoxyBuildToolingTraceOption Condition="$(EpoxyBuildTrace)"> -t</EpoxyBuildToolingTraceOption> |
104 |
| - <EpoxyBuildToolingDebugOption Condition="$(EpoxyBuildDebug)"> -d</EpoxyBuildToolingDebugOption> |
| 67 | + <_EB_ToolingRuntimeName Condition="'$(_EB_ToolingRuntimeName)' == ''">$(_EB_RuntimeName)</_EB_ToolingRuntimeName> |
| 68 | + <_EB_ToolingDir Condition="'$(_EB_ToolingDir)' == ''">$(_EB_ToolingCandidateDir)</_EB_ToolingDir> |
| 69 | + <_EB_ToolingPath Condition="'$(_EB_ToolingPath)' == ''">$([System.IO.Path]::Combine('$(_EB_ToolingDir)','$(_EB_ExecutableName)'))</_EB_ToolingPath> |
| 70 | + <_EB_ToolingTraceOption Condition="'$(EpoxyBuildTrace)' == 'True'"> -t</_EB_ToolingTraceOption> |
| 71 | + <_EB_ToolingDebugOption Condition="'$(EpoxyBuildDebug)' == 'True'"> -d</_EB_ToolingDebugOption> |
105 | 72 | </PropertyGroup>
|
106 | 73 |
|
107 |
| - <GetCombinedReferencesBasePath References="@(ReferencePath)"> |
108 |
| - <Output TaskParameter="CombinedReferencesBasePath" PropertyName="CombinedReferencesBasePath" /> |
109 |
| - </GetCombinedReferencesBasePath> |
| 74 | + <_EB_GetCombinedReferencesBasePath References="@(ReferencePath)"> |
| 75 | + <Output TaskParameter="CombinedReferencesBasePath" PropertyName="_EB_CombinedReferencesBasePath" /> |
| 76 | + </_EB_GetCombinedReferencesBasePath> |
110 | 77 |
|
111 |
| - <Exec WorkingDirectory="$(EpoxyBuildToolingDir)" |
112 |
| - Command="$(EpoxyBuildToolingRuntimeName)"$(EpoxyBuildToolingPath)"$(EpoxyBuildToolingTraceOption)$(EpoxyBuildToolingDebugOption) "$(CombinedReferencesBasePath)" "$(ProjectDir)$(IntermediateOutputPath)$(TargetFileName)"" /> |
| 78 | + <Exec WorkingDirectory="$(_EB_ToolingDir)" |
| 79 | + Command="$(_EB_ToolingRuntimeName)"$(_EB_ToolingPath)"$(_EB_ToolingTraceOption)$(_EB_ToolingDebugOption) "$(_EB_CombinedReferencesBasePath)" "$(ProjectDir)$(IntermediateOutputPath)$(TargetFileName)"" /> |
113 | 80 | </Target>
|
114 | 81 | </Project>
|
0 commit comments