Does anybody know a way to check if a file was already included?
<include buildfile="${script.dir}\util.include.nant" />
.
.
.
.
<include buildfile="${script.dir}\util.include.nant" />
This will throw an exception that a target was duplicated. Is there a way around?
Thanks in advance
Just saw this question which seems related and decided to change the case of one of the duplicate includes in a.build in my other answer to:
Boom - duplicate target error. Looks like nant is bright enough to ignore duplicate includes, but is case sensitive when comparing them.
This minimal example works OK for me in nant 0.86.3075.0:
In this example, a.build and b.build both include c.build multiple times. a.build and b.build also include each other, but do not depend on each other's targets as this creates a circular dependency.
Note the use of echo at project level - these seem to come out as the files are included, which may help you debug your issue.
a.build:
b.build:
c.build:
output: