Not able to call build.properties file from build.xml

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2008
Posts: 1
Reputation: gaurav_chhabra is an unknown quantity at this point 
Solved Threads: 0
gaurav_chhabra gaurav_chhabra is offline Offline
Newbie Poster

Not able to call build.properties file from build.xml

 
0
  #1
Aug 14th, 2008
Hi,



I am using cruise control on Windows XP. We have CVS as our version control
tool. I am using the following four files to achieve build of my code.

1. config.xml (This file is present in cruise control directory and it calls
up the file 'tc-build.xml'.)

2. tc-build.xml (This file is in a directory where we store the checked out
code from the CVS repository. This file performs

the code check-out operation and also calls the file 'build.xml' to perform
code build on the checked out code.)

3. build.xml (This file performs the actual code build. This file is part of
the checked out code.)

4. build.properties (Contains the value of variables present in build.xml.
This file is also part of the checked out code.)



My Problem: I am able to successfully check out the code from CVS repository
but I think that the code build operation is not happening. Somehow the file
'build.xml' is not able to call the file 'build.properties'. I am saying
this because as soon as the build stops, I can notice two directories with
the name "${build.classes.dir}" & "${dist.dir}" created inside directory
'ant' which is definitely not the desired result.


The content of all the files are as stated under:

config.xml --->
-------------------------------------------------
  1. <?xml version="1.0" ?>
  2.  
  3. <cruisecontrol>
  4. <project name="TCProject">
  5.  
  6.  
  7. <bootstrappers>
  8. <currentbuildstatusbootstrapper
  9. file="E:\TC_CC_BuildArea\logs\tc\buildstatus.txt" />
  10. </bootstrappers>
  11.  
  12.  
  13. <schedule interval="600">
  14. <ant buildfile="E:\TC_CC_BuildArea\tc-build.xml" target="build" />
  15. </schedule>
  16.  
  17.  
  18. <modificationset quietperiod="10">
  19. <cvs
  20. localworkingcopy="E:\TC_CC_BuildArea\CodeCheckOut\TC_Repository_Code\" />
  21. </modificationset>
  22.  
  23.  
  24. </project>
  25. </cruisecontrol>
  26.  
-------------------------------------------------


tc-build.xml --->
-------------------------------------------------
  1. <?xml version="1.0" ?>
  2.  
  3. <project name="TCBuild" default="build" basedir="CodeCheckOut" >
  4. <target name="build">
  5. <delete dir="TC_Repository_Code" />
  6. <cvs cvsroot="E:\CVS_Repository\"
  7. package="TC_Repository_Code" />
  8. <ant antfile="build.xml"
  9. dir="E:\TC_CC_BuildArea\CodeCheckOut\TC_Repository_Code\ant" target="war" />
  10. </target>
  11. </project>
  12.  
-------------------------------------------------


build.xml --->
-------------------------------------------------
  1. <project name="Test" default="war" basedir="..">
  2.  
  3. <property file="ant/build.properties"/>
  4.  
  5. <target name="help">
  6. <echo>
  7. 1. war - This will build the war file for the project.
  8. 2. jar - This will create the jar file containing all
  9. application classes files.
  10. 3. compile - This will compile the java classes
  11. </echo>
  12. </target>
  13.  
  14. <!--create directories-->
  15. <target name="init">
  16. <mkdir dir="${build.classes.dir}"/>
  17. <mkdir dir="${dist.dir}"/>
  18. </target>
  19. <!--clean directories-->
  20. <target name="clean">
  21. <deltree dir="${build.dir}"/>
  22. <deltree dir="${dist.dir}"/>
  23. </target>
  24.  
  25. <!--build war file-->
  26. <target name="war" depends="jar">
  27. <copydir src="${external.libs.dir}" dest="${targetlibdir}"
  28. includes="*.jar"
  29.  
  30. excludes="servlet-api.jar,mail.jar,activation.jar"/>
  31. <copy file="${jar}" todir="${targetlibdir}"/>
  32. <war warfile="${war}" webxml="web/WEB-INF/web.xml">
  33. <fileset dir="${basedir}/web">
  34. <include name="images/**/*.*" />
  35. <include name="css/**/*.*" />
  36. <include name="js/**/*.*"/>
  37. <include name="jsp/**/*.*"/>
  38. <include name="*.jsp" />
  39. <include name="WEB-INF/**/*.*" />
  40. </fileset>
  41. <fileset dir="${build.dir}/web">
  42. <include name="WEB-INF/**/*.*" />
  43. </fileset>
  44. </war>
  45. </target>
  46.  
  47. <target name="jar" depends="compile">
  48. <copy file="${src.dir}/com/tc/struts/ApplicationResource.properties"
  49.  
  50. todir="${build.dir}/web/WEB-INF/classes/com/tc/struts"/>
  51. <jar jarfile="${jar}">
  52. <fileset dir="${build.classes.dir}">
  53. <include name="**/*.*" />
  54. </fileset>
  55. </jar>
  56. <deltree dir="${build.classes.dir}"/>
  57. </target>
  58.  
  59. <!-- compile files-->
  60. <target name="compile" depends="clean,init">
  61. <javac srcdir="${src.dir}/com"
  62. destdir="${build.classes.dir}"
  63. includes="**/*.*"
  64. debug="on"
  65. deprecation="on"
  66. optimize="off">
  67. <classpath>
  68. <fileset dir="${libs.dir}" includes="**/*.jar"/>
  69. </classpath>
  70. </javac>
  71. </target>
  72.  
  73. <target name="deploy">
  74. <copy file="${war}" todir="${jboss.deploy.dir}"
  75. overwrite="true"/>
  76. </target>
  77. </project>
-------------------------------------------------


build.properties --->
-------------------------------------------------
  1. appname=GC
  2. src.dir=${basedir}/src/java
  3. build.dir=${basedir}/build
  4. build.classes.dir=${build.dir}/web/WEB-INF/classes
  5. targetlibdir=${build.dir}/web/WEB-INF/lib
  6. dist.dir=${basedir}/dist
  7. libs.dir=${basedir}/lib
  8. external.libs.dir=${libs.dir}/external
  9. war =${dist.dir}/gc.war
  10. jar=${dist.dir}/gc.jar
  11. jboss.home.dir=E:\jboss-4.2.2.GA
  12. jboss.deploy.dir=${jboss.home.dir}/server/default/deploy
-------------------------------------------------


Can anyone please guide me?




Regards,
Gaurav
Last edited by Tekmaven; Aug 14th, 2008 at 4:09 pm. Reason: Code tags
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 2100 | Replies: 0
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC