tags:

views:

38

answers:

2

Hiya.

I downloaded a red5 ant sample project. (http://osflash.org/red5) the project contains several XML files that contain @new.project.name@ parameter:

build.xml
ivy.xml
src/logback.xml
www/WEB-INF/red5-web.properties
www/WEB-INF/web.xml

now.. should i edit and manually replace @new.project.name@ with the actual project name or is there something that automatically does this for me?

+2  A: 

Those look like they're meant to be replaced by Ant's <replace> task. Is it possible that build.xml contains the logic for this (and therefore also the string to be replaced)? There should also be something about this in the project documentation.

Michael Borgwardt
first of all thanks for the information.the build.xml does not contain any replace related directives. the project name itself in build.xml is tagged with @new.project.name@: <project name="@new.project.name@" basedir="." default="war" xmlns:ivy="antlib:org.apache.ivy.ant">
ufk
@ufk: I'd definitely expect the project documentation to contain information about the steps that are needed to set up the project. Or it may be that Tal has the right idea and the replacement happens in a copy task.
Michael Borgwardt
+2  A: 

Ant copy task has the ability to replace those strings while running the ant build. Here for example I can replace a @BRANCH@ token:

<copy file="${basedir}/.project.base" tofile="${basedir}/.project">
<filterchain>
    <replacetokens>
        <token key="BRANCH" value="${branch}"/>
    </replacetokens>
</filterchain>
</copy>
Tal
Ah, I though I had seen the @token@ syntax specifically somewhere.
Michael Borgwardt
thank you for the information. it helped expain the workflow of ant replace filter chain.
ufk