Filterset begintoken

Posted on 2009-12-22
Last Modified: 2013-11-10
I am trying to use filterset. I have managed to do it in one way but when I try to do it in a diffent way it wont work. It has to do with that the filterset cant be empty. How can I make this work?

So this is the situations.
1. Hudson builds with build.xml file
2. Hudson puts in all info from version.template to (this works fine)
3. sync_to_clearcase.xml is running but it wont change the label gal.version.hudson.clearcase.tag=No tag. No sync yet.

So this is where it goes wrong
<filterset begintoken="No tag" endtoken="yet.">

What should I write so it finds the NO tag. No sync yet and exchange it?


<target name="compile_after_ext">

	        <echo>Substituting values in</echo>


	                <format property="build_tstamp" pattern="yyyy-MM-dd,HH:mm:ss" />


	        <property environment="env" />

	        <property name="env.JOB_NAME" value="Not built from Hudson" />

	        <property name="env.BUILD_ID" value="Not built from Hudson - ${build_tstamp}" />

	        <property name="env.BUILD_TAG" value="Not built from Hudson - no tag" />

	        <property name="env.SVN_BRANCH" value="SVN_BRANCH was not specified" />

	        <property name="env.BUILD_NUMBER" value="Not built from Hudson - ${build_tstamp}" />

	        <property name="env.HUDSON_BUILD" value="Not built from Hudson" />

	        <property name="env.CLEARCASE_TAG" value="Not built from Hudson" /> 

	        <property name="env.VERSION_TAG" value="" /> 

	        <copy file="resources/version/" toFile="resources/version/" overwrite="true" >

	            <filterset begintoken="$${" endtoken="}">

	                <filter token="" value="${env.JOB_NAME}"/>

	                <filter token="" value="${env.BUILD_ID}"/>

	                <filter token="" value="${env.BUILD_TAG}"/>

	                <filter token="hudson.svn.branch" value="${env.SVN_BRANCH}"/>

	                <filter token="" value="${env.BUILD_NUMBER}"/>

	                <filter token="hudson.subversion.tag" value="trunk-V2-${env.BUILD_NUMBER}-${env.BUILD_ID}"/>    

	                <filter token="hudson.clearcase.tag" value="No tag. No sync yet."/>   

	                <filter token="hudson.version.tag" value=""/>           












--------------------------------------- built from Hudson - 2009-12-04,13:57:40

gal.version.number=Not built from Hudson - 2009-12-04,13:57:40

gal.version.tag=SVN_BRANCH was not specified-Not built from Hudson - 2009-12-04,13:57:40 built from Hudson


gal.version.hudson.clearcase.tag=No tag. No sync yet.





<target name="start5" >

		<property name="subversion.tag" value="P_trunk_${env.BUILD_ID}" /> 

		<echo>Substituting values in for P view in clearcase</echo>

  	<property environment="env" />        

 		 <copy file="../../resources/version/" toFile="../../Dresources/version/" overwrite="true" >

  			<filterset begintoken="No tag" endtoken="yet.">

  					<filter token="No tag. No sync yet." value="P_trunk_${env.BUILD_ID}"/>              




 		 <move file="../../Dresources/version/" toFile="../../resources/version/" overwrite="true" />

		<antcall target="do-the-stuff"/>


Open in new window

Question by:Mickeys
    LVL 5

    Expert Comment

    The begin/end token marks the prefix/suffix of the token.
    So with the beginToken="No tag" and endToken="yet." the token should be ". No sync " i.e.
     beginToken+token+endToken="No tag. No sync yet".

    Author Comment

    I didnt really understand that.

    If this is what I want to look for:  No tag. No sync yet

    What should here be written instead for this?
    beginToken="No tag" and endToken="yet."
    LVL 5

    Expert Comment

    With the beginToken and endToken you're using the token becomes '. No sync '.

    If beginToken and endToken is @ then you're matching @XXXX@ where XXXX is the token.
    You have beginToken=No tag (the first @), and endToken=yet. (the last @).

    Author Comment

    So I shold write what (???)  to make it
    No tag. No sync yet.
    LVL 5

    Accepted Solution

    To follow your setup replace the filterset in sync_to_clearcase.xml with the following:

    <filterset begintoken="No tag" endtoken="yet.">
      <filter token=". No sync " value="P_trunk_${env.BUILD_ID}"/>              

    Author Closing Comment

    It works. Thx

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    dangers of teaching programming 10 104
    How to make AngularJS IntelliSense working in VS 2012 4 128
    error when i compile 5 405
    Eclipse for PHP 1 84
    Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deletiā€¦
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now