Re: Ant task properties not working

Lars Ködderitzsch <[email protected]>
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
Hi,

I think the properties attribute of the Checkstyle task is just used to 
override already existing Ant properties,
see here: http://checkstyle.sourceforge.net/anttask.html

To just load your properties as regular Ant properties use the property 
Ant task, for instance
<property file="foo.properties"/>

If done so they will be visible to the Checkstyle Ant task.

Hope that helps,
Lars Ködderitzsch


Nathaniel Stoddard wrote:
> I'm having a hard time setting the basedir property for the ant task.  When 
> I put it directly in the checkstyle XML config file, it works.  (I have 
> about 10 projects and want to reuse that file, so I don't want the path in 
> it.)
>
> My ant task is:
>
> <target name="checkstyle" depends="compile">
>     <taskdef  resource="checkstyletask.properties" 
> classpath="/dev/tools/checkstyle-4.3/checkstyle-all-4.3.jar"/>
>     <checkstyle config="../configuration/checkstyle/checks.xml" 
> properties="src/conf/checkstyle.properties">
>         <fileset dir="src/java" includes="**/*.java" />
>         <formatter type="xml" tofile="build/checkstyle/report.xml" />
>     </checkstyle>
>     <xslt in="build/checkstyle/report.xml" 
> out="build/checkstyle/report.html" 
> style="../configuration/checkstyle/report.xsl" />
>  </target>
>
> I've tried about every combination of "checkstyle.basedir", "basedir" for 
> the property key -- trying to get the darn thing to work from a properties 
> file, and as a nested property.  Nothing seems to work.  (I tried the same 
> thing with the cache file and noticed that it was never created where it 
> should have been.)  Can anybody tell me how I am supposed to do this?  All 
> I'm trying to do is trim the full path to just the package name in the 
> report XML file.  Thanks for any help!
>
> Nathaniel Stoddard 
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Checkstyle-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>
>   


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.