目标批处理-请提供一些帮助 [英] Target Batching - some help please
问题描述
章
也许有人可以帮助我吗?尽管MSBuild日志告诉我该目标已被跳过,但我似乎仍在执行目标.
maybe someone can help me out? I seem to have a target executing despite the MSBuild log telling me it has been skipped.
我最近几次见过-这是我的标准模式-我很想知道我到底在做错什么.
I've seen this a few times recently - and as it's a standard pattern of mine - I'd love to know what on earth I am doing wrong.
我的跳过"目标创建了一个新列表(FilesToBeLinted),准备由第三个目标使用. 因此,尽管日志告诉我目标已被跳过,但列表仍会被填充(我稍后会回显它).
My 'skipped' target creates a new list (FilesToBeLinted) ready for consumption by a third target. So, despite the log telling me that the target is skipped, the list still gets populated (I echo it out later).
<Target Name="_JSLint" DependsOnTargets="_FindJSAndCss" Inputs="%(JS.Identity)" Outputs="%(JS.Identity).lint">
<!-- There is a bug here - @(FilesToBeLinted) always gets set
Can't find it for the life of me -->
<Error Text="Foo"/>
<PropertyGroup>
<FileToLint>$([System.IO.Path]::GetFullPath(%(JS.Identity)))</FileToLint>
</PropertyGroup>
<Message Text="$(FileToLint) needs linting" />
<ItemGroup>
<FilesToBeLinted Include="$(FileToLint)" />
</ItemGroup>
</Target>
<!-- Common -->
<Target Name="_FindJSAndCss">
<ItemGroup>
<JS Include="@(JSSearchPaths)" Exclude="@(JSExcludePaths)" />
<!--<CSS Include="@(CssSearchPaths)" Exclude="@(CssExcludePaths)" />-->
<CssAndJs Include="@(JS);@(CSS)" />
<OldLintReports Include="**\*.js.lint" />
<OldMinifiedFiles Include="**\*.css.min;**\*.js.min;**\$(CssCombinedFileRelPath);**\$(JSCombinedFileRelPath)" />
</ItemGroup>
<Message Text="JS=@(JS)" />
<Message Text="CSS=@(CSS)" />
<Message Text="CssAndJs=@(CssAndJs)" />
<Message Text="OldLintReports=@(OldLintReports)" />
<Message Text="OldMinifiedFiles=@(OldMinifiedFiles)" />
</Target>
我已将Error任务放入调试中.
I have put the Error task in for debugging.
附上是我调试时的屏幕截图. 我对调试器的了解不足,无法确切知道目标中的执行箭头的含义
Attached is a screenshot when I am debugging. I don't know enough of the debugger to know exactly what the execution arrow being in the target means
非常感谢您的帮助.
Neil
推荐答案
这是回显了FilesToBeLinted列表的日志:
Here's the log with the FilesToBeLinted list echo'd out:
_FindJSAndCss:
JS=JavaScript\HRnetRevolution Base.js;JavaScript\HRnetRevolution Mixin _controlBase.js;JavaScript\HRnetRevolution Mixin _dirtyCheckMixin.js;JavaScript\HRnetRevolution Mixin _fieldBase.js;JavaScript\HRnetRevolution Mixin _notificationHandler.js;JavaScript\HRnetRevolution Mixin _sectionBase.js;JavaScript\HRnetRevolution Mixin _validationBase.js
CSS=
CssAndJs=JavaScript\HRnetRevolution Base.js;JavaScript\HRnetRevolution Mixin _controlBase.js;JavaScript\HRnetRevolution Mixin _dirtyCheckMixin.js;JavaScript\HRnetRevolution Mixin _fieldBase.js;JavaScript\HRnetRevolution Mixin _notificationHandler.js;JavaScript\HRnetRevolution Mixin _sectionBase.js;JavaScript\HRnetRevolution Mixin _validationBase.js
OldLintReports=JavaScript\HRnetRevolution Base.js.lint;JavaScript\HRnetRevolution Mixin _controlBase.js.lint;JavaScript\HRnetRevolution Mixin _dirtyCheckMixin.js.lint;JavaScript\HRnetRevolution Mixin _fieldBase.js.lint;JavaScript\HRnetRevolution Mixin _notificationHandler.js.lint;JavaScript\HRnetRevolution Mixin _sectionBase.js.lint;JavaScript\HRnetRevolution Mixin _validationBase.js.lint
OldMinifiedFiles=JavaScript\HRnetRevolution Base.js.min;JavaScript\HRnetRevolution Mixin _controlBase.js.min;JavaScript\HRnetRevolution Mixin _dirtyCheckMixin.js.min;JavaScript\HRnetRevolution Mixin _fieldBase.js.min;JavaScript\HRnetRevolution Mixin _notificationHandler.js.min;JavaScript\HRnetRevolution Mixin _sectionBase.js.min;JavaScript\HRnetRevolution Mixin _validationBase.js.min;JavaScript\HRnetRevolution.js
*********FilesToBeLinted*********:
_JSLint:
Skipping target "_JSLint" because all output files are up-to-date with respect to the input files.
_JSLint:
Skipping target "_JSLint" because all output files are up-to-date with respect to the input files.
_JSLint:
Skipping target "_JSLint" because all output files are up-to-date with respect to the input files.
_JSLint:
Skipping target "_JSLint" because all output files are up-to-date with respect to the input files.
_JSLint:
Skipping target "_JSLint" because all output files are up-to-date with respect to the input files.
_JSLint:
Skipping target "_JSLint" because all output files are up-to-date with respect to the input files.
_JSLint:
Skipping target "_JSLint" because all output files are up-to-date with respect to the input files.
CommonJSLint:
*********FilesToBeLinted*********: C:\NeilTest\Branch4\Solution1\ConsoleExe\JavaScript\HRnetRevolution Base.js;C:\NeilTest\Branch4\Solution1\ConsoleExe\JavaScript\HRnetRevolution Mixin _controlBase.js;C:\NeilTest\Branch4\Solution1\ConsoleExe\JavaScript\HRnetRevolution Mixin _dirtyCheckMixin.js;C:\NeilTest\Branch4\Solution1\ConsoleExe\JavaScript\HRnetRevolution Mixin _fieldBase.js;C:\NeilTest\Branch4\Solution1\ConsoleExe\JavaScript\HRnetRevolution Mixin _notificationHandler.js;C:\NeilTest\Branch4\Solution1\ConsoleExe\JavaScript\HRnetRevolution Mixin _sectionBase.js;C:\NeilTest\Branch4\Solution1\ConsoleExe\JavaScript\HRnetRevolution Mixin _validationBase.js
这篇关于目标批处理-请提供一些帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!