C#C
C#3y ago
18 replies
n8ta

How to run a target when any of a set of input files has changed?

I'm trying to build a large project that msbuild does not understand via a <Target> with the inputs parameter as a list of all source files in that project and outputs as the single file the build produces. However, even when I change a file in the Inputs of the <Target> the target is not re-run. There is not a 1-1 mapping between inputs and outputs.

  <Target Name="CustomJsBuildLocal" Inputs="@(JsInputFiles)" Outputs="@(JSOutputFiles)">
    <Message Importance="High" Text="Building" />
    <Exec ConsoleToMsBuild="true" Command="some kinda slow command based on input fules" WorkingDirectory="$(BuildFolder)">
      <Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" />
    </Exec>
  </Target>
Was this page helpful?