Bob
Bob

Reputation: 4970

msbuild - how to see value of Inputs and Outputs for a Target

I've enabled "Diagnostic"-level logging for my build.

However, I still don't see an entry for Inputs and Outputs in my build log.

Without me manually outputting it, is there a way to force it to appear in the properties list of the target?

<Target Name="buildelf" Inputs="$(LDFILE);$(OBJFILES)" Outputs="$(ELFFILE)">
...

I can see values of $(OBJFILES) and $(LDFILE)

Task Parameter:

Properties=
OBJFILES=.\Output\Objects\HW_Interface.doj
      .\Output\Objects\A_HW_Module.doj
      .\Output\Objects\HeapMngr.doj
LDFILE=C:\work\CANary.CPU.A.APP.ld  ELFFILE=C:\work\APP.elf (TaskId:23594)

but from the log, when MSBuild says. . .

Skipping target "buildelf" because all output files are up-to-date with respect to the input files.

. . .I'd like to know what the inputs and outputs are.

Upvotes: 2

Views: 718

Answers (1)

Jacek Blaszczynski
Jacek Blaszczynski

Reputation: 3269

If your goal is to print value of property $(ELFFILE) it can be done as an additional action during build. For instance you can add the following target and tasks to your project to explicitly print property values to output and log:

    <Target Name="DisplayMyProperties">  
            <Message Importance="High" Text="Output files: $(ELFFILE)" />  
            <Message Importance="High" Text="Input files: $(LDFILE);$(OBJFILES)" />  
    </Target>
    <Target Name="buildelf" DependsOnTargets="DisplayMyProperties" Inputs="$(LDFILE);$(OBJFILES)" Outputs="$(ELFFILE)">

This should force print all properties values before they will be executed or skipped in buildelf target. However, it seems that your project has custom structure and this may require tweaking the location where DisplayMyProperties target will be executed. It should be executed after values of $(LDFILE), $(OBJFILES), $(ELFFILE) are populated and independently of execution of buildelf target.

Upvotes: 1

Related Questions