troubleshooting Question

Filterset begintoken

Avatar of Mickeys
MickeysFlag for Sweden asked on
Editors IDEs
6 Comments1 Solution914 ViewsLast Modified:
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 version.properties (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?
build.xml
---------------------------------
<target name="compile_after_ext">
	        <echo>Substituting values in version.properties</echo>
	            <tstamp>
	                <format property="build_tstamp" pattern="yyyy-MM-dd,HH:mm:ss" />
	            </tstamp>

	        <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="1.0.0.0" /> 

	        <copy file="resources/version/version.properties.template" toFile="resources/version/version.properties" overwrite="true" >
	            <filterset begintoken="$${" endtoken="}">
	                <filter token="hudson.job.name" value="${env.JOB_NAME}"/>
	                <filter token="hudson.build.id" value="${env.BUILD_ID}"/>
	                <filter token="hudson.build.tag" value="${env.BUILD_TAG}"/>
	                <filter token="hudson.svn.branch" value="${env.SVN_BRANCH}"/>
	                <filter token="hudson.build.number" 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="1.0.0.0"/>           
	            </filterset>
	        </copy>
	    </target>


version.template
------------------------------------
gal.version.id=${hudson.build.id}
gal.version.number=${hudson.build.number}
gal.version.tag=${hudson.svn.branch}-${hudson.build.id}
gal.version.job.name=${hudson.job.name}
gal.version.hudson.subversion.tag=${hudson.subversion.tag}
gal.version.hudson.clearcase.tag=${hudson.clearcase.tag}
gal.version.version=${hudson.version.tag}
PrintNetKnap=${hudson.build.number}




version.properties
---------------------------------------
gal.version.id=Not 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
gal.version.job.name=Not built from Hudson
gal.version.hudson.subversion.tag=P-trunk-V2-99-2009-05-20_02-01-31
gal.version.hudson.clearcase.tag=No tag. No sync yet.
gal.version.version=${hudson.version.tag}
PrintNetKnap=332



sync_to_clearcase.xml
---------------------------------

<target name="start5" >
		<property name="subversion.tag" value="P_trunk_${env.BUILD_ID}" /> 
		<echo>Substituting values in version.properties for P view in clearcase</echo>
  	<property environment="env" />        
 		 <copy file="../../resources/version/version.properties" toFile="../../Dresources/version/version.properties.tmp" overwrite="true" >
  			<filterset begintoken="No tag" endtoken="yet.">
  					<filter token="No tag. No sync yet." value="P_trunk_${env.BUILD_ID}"/>              
  			</filterset>
  		</copy>	
        
 		 <move file="../../Dresources/version/version.properties.tmp" toFile="../../resources/version/version.properties" overwrite="true" />
		<antcall target="do-the-stuff"/>
	</target>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros