I've created a custom MSBuild
.targets file that I've included in a Delphi XE project via the IDE and enabled it from the Project Manager's context menu. Although the file validates, it always gets disabled after I re-save the project file.
Here's a simplified version of the targets file, named
<Message Text="Hello from custom target"/>
As a stand alone file this works as expected: typing...
MSBuild Custom.target /t:Hello
...at the command line gives the expected message.
Custom.targets to a Delphi project via the IDE displays the file in the Project Manager as expected, and the
.dproj file now contains the line...
I right-clicked the file in the IDE's Project Manager and selected
Enable. But when the project is built the
Build message window displays:
[MSBuild Warning] Custom.targets(1): Ignoring disabled import:
Right-clicking again in Project Manager still shows the
Enable option instead of the expected
At the command line
MSBuild ProjectName.dproj /t:Hello also fails.
I've tried hacking the
.dproj file to add the line...
MSBuild ProjectName.dproj /t:Hello now works. But the next time I save the project file from the IDE the
<Import> statement gets removed.
Anyone got any idea what's going wrong please?