" because it has no outputs I already did a little discussion with MSBuild before, but this is my first forray...">

MSBuild and skip target "<TargetName>" because it has no outputs

I already did a little discussion with MSBuild before, but this is my first forray in partial builds. I have everything to work, but not as good as I would like. I can not get around this message:

Skipping target "BuildLocalizerSetting" because it has no outputs. Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists.

If I remove the Inputs attribute from the target, everything will be fine. I suspect this is due to missing transformations, but specifying a transform is actually not possible.

My setup is slightly different from a typical build scenario. I have a manifest file that contains a list of files that need to be compiled. That is, I pass from the script when one input file generates a potentially long list of elements in a group of elements.

I am creating a custom task to parse a manifest file and it seems to be performing this task well. Although I encountered one problem, TaskItem does not allow you to set some well-known metadata, for example: “File Name”, “Extension”, “Modified Time”, etc. This problem was quickly resolved by implementing ITaskItem in a custom TaskItem class. I know that a dirty check works as it should, since MSBuild detects that these elements have been changed. But now I wonder ... Can I risk creating a build error on some odd platform due to this implementation?

But most importantly, why can't MSBuild accept that the inputs have changed and then concluded that the outputs have also changed?

Each example that I found suggests either a relationship between input and output, or a plurality of one, but in my scenario I move from one to another, can this be done?

+5
source share

Source: https://habr.com/ru/post/1208649/


All Articles