ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Pellow" <nick.pel...@mindmatics.de>
Subject AW: AW: Setting project name with a property?
Date Thu, 08 Aug 2002 08:29:35 GMT
>
> But it looks like you're in luck (from XMLLogHelper.java, and which
> EmailPublisher.java calls to form the Subject line):
>   /**
>    *  @return project name as defined in the ant build file
>    */
>     public String getProjectName() throws CruiseControlException {
>         return getAntProperty("ant.project.name");
>     }
>
> So, define away :)  Just be sure you don't have a 'name' attribute set in
> the <project> tag, or your define will be ignored, since Project.java just
> sets ant.project.name based on the value for 'name' -- it doesn't check to
> see if ant.project.name is already set.
>
> Diane

Thanks Diane,
I have already checked all that, the problem is that getAntProperty()
looks like this:
 /**
     *  @param propertyName the name of the ant property
     *  @return the value of the ant property
     */
    public String getAntProperty(String propertyName) throws
CruiseControlException {
        Iterator propertyIterator =
_log.getChild("build").getChild("properties").getChildren("property").iterat
or();
        while(propertyIterator.hasNext()) {
            Element property = (Element) propertyIterator.next();
            if(property.getAttributeValue("name").equals(propertyName)) {
                return property.getAttributeValue("value");
            }
        }
        throw new CruiseControlException("Property: " + propertyName + " not
found.");
    }

We tried setting -Dant.project.name="dynamic" before starting CC. This lead
to
getAntProperty("ant.project.name") returning null.

I think CruiseControl should just change to make the email subject
configurable
in the properties file.

Cheers,
Nick






--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message