Are the keywords used for project, target, task, function, ... in NAnt build files case sensitive or not?
+3
A:
Try this NAnt build script:
<?xml version="1.0" encoding="utf-8" ?>
<!-- ====================================================================== -->
<!-- test case sensitiveness -->
<!-- ====================================================================== -->
<project name="test.casesensitiveness" default="test">
<target name="test">
<property name="foo" value="bar" />
<echo message="Does property 'foo' exist? ${property::exists('foo')}" />
<echo message="Does property 'Foo' exist? ${property::exists('Foo')}" />
</target>
</project>
Here is the output:
test:
[echo] Does property 'foo' exist? True
[echo] Does property 'Foo' exist? False
So, yes identifiers in NAnt are case-sensitive.
The Chairman
2010-02-25 12:37:47
I've used your test to try. And I found that not only identifiers but also keywords such as target, project are case-sensitive.Thanks a lot The Chairman.
Nam Gi VU
2010-02-28 05:45:35
+1
A:
Do you mean the keyword such as "target" vs "Target"? Why not just give it a try yourself?
In any case, all of the example and docs specifies lower case, so it's probably better to stick to the common standard.
Charles
2010-02-25 15:26:38
Hi there, I'm a newbie using NAnt so that I post the quetion raised on my mind while I read about NAnt. I myself still not sure how to run a HelloWorld sample using NAnt -> That's why I ask.
Nam Gi VU
2010-02-28 05:27:51
+1
A:
In a word: Yes.
NAnt is case-sensitive, even if Windows isn't fussed.
Brett Rigby
2010-03-29 15:21:04