[Carrot2-cvs] carrot2/components/controllers/carrot2-web-controller carrot2-web-controller.dep.xml,N
Brought to you by:
dawidweiss,
stachoo
From: <daw...@us...> - 2004-02-06 18:19:37
|
Update of /cvsroot/carrot2/carrot2/components/controllers/carrot2-web-controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4867/components/controllers/carrot2-web-controller Modified Files: build.xml Added Files: carrot2-web-controller.dep.xml Log Message: [new], component: global Added a new ANT task to manage JAR interdependencies in the project. Now you can easily collect all JARs that a component requires, plus only these JARs are use d at compile-time. Try using these targets on build files of components: 'ant show.dependencies' (shows all required components and JAR files), 'ant collect.dependencies' (copies the required JARs to the distribution.dir folder). [refactoring], component: global Build files have changed, so ANT1.6 is now a requirement. --- NEW FILE: carrot2-web-controller.dep.xml --- <!-- A dependency descriptor. This has to be updated manually when new JARs are required. --> <component name="carrot2-web-controller"> <dependency name="carrot2-shared-lib" /> <!-- replace this with jdk's? --> <dependency name="gnu-regexp" /> <file location="lib/bsf.jar" /> <file location="lib/bsh-1.2b7.jar" /> <dependency name="put-utils" /> <dependency name="struts" /> </component> Index: build.xml =================================================================== RCS file: /cvsroot/carrot2/carrot2/components/controllers/carrot2-web-controller/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.xml 19 Jan 2004 22:18:45 -0000 1.3 --- build.xml 6 Feb 2004 18:16:20 -0000 1.4 *************** *** 3,7 **** <project name="Carrot2 Web Controller Component" default="help" basedir="." > ! <!-- ## these are overrioden my master build file ### --> <property name="distribution.dir" location="tmp/dist" /> --- 3,7 ---- <project name="Carrot2 Web Controller Component" default="help" basedir="." > ! <!-- ## these are overrioden by the master build file ### --> <property name="distribution.dir" location="tmp/dist" /> *************** *** 27,53 **** <property name="javac.debug" value="on" /> - <!-- ## classpath for compiling classes ## --> - - <path id="carrot.shared.libs"> - <!-- all jars runtime/shared/lib --> - <fileset dir="${carrot2.cvs.dir}/lib"> - <include name="**/*.jar"/> - </fileset> - </path> - <!-- ## project classpath ### --> - <path id="compile.classpath"> - <fileset dir="lib"> - <include name="**/*.jar" /> - </fileset> - <path refid="carrot.shared.libs" /> - </path> - <filterset begintoken="@" endtoken="@" id="deployment.info"> <filter token="DEPLOY_HOST" value="${deployment.host}"/> <filter token="DEPLOY_PORT" value="${deployment.port}"/> </filterset> <!-- ##################################### --> <!-- ### {{{ CLEAN ### --> --- 27,86 ---- <property name="javac.debug" value="on" /> <!-- ## project classpath ### --> <filterset begintoken="@" endtoken="@" id="deployment.info"> <filter token="DEPLOY_HOST" value="${deployment.host}"/> <filter token="DEPLOY_PORT" value="${deployment.port}"/> </filterset> + + <!-- ##################################### --> + <!-- ### {{{ DEPENDENCY analysis ### --> + <!-- ##################################### --> + <property name="component.descriptor" location="carrot2-web-controller.dep.xml" /> + <target name="define.dependency.task"> + <taskdef resource="com/dawidweiss/carrot/ant/dependencies.antlib.xml"> + <classpath location="${carrot2.cvs.dir}/lib/carrot2-shared-lib.jar" /> + </taskdef> + </target> + + <target name="generate.dependency.path" depends="define.dependency.task"> + <dependencylist + property="component.dep" + fileListId="component.dep.flist" + componentDescriptor="${component.descriptor}" + verbose="false" + > + <dependencies dir="${carrot2.cvs.dir}/lib"> + <include name="*.dep.xml" /> + </dependencies> + </dependencylist> + <path id="classpath.dependencies"> + <filelist refid="component.dep.flist" /> + </path> + </target> + + <target name="show.dependencies" depends="define.dependency.task"> + <dependencylist componentDescriptor="${component.descriptor}" verbose="on"> + <dependencies dir="${carrot2.cvs.dir}/lib"> + <include name="*.dep.xml" /> + </dependencies> + </dependencylist> + </target> + + <target name="collect.dependencies" depends="prepare"> + <dependencylist componentDescriptor="${component.descriptor}" verbose="on" + fileListId="component.dep.flist"> + <dependencies dir="${carrot2.cvs.dir}/lib"> + <include name="*.dep.xml" /> + </dependencies> + </dependencylist> + + <copyfilelist todir="${distribution.dir}"> + <filelist refid="component.dep.flist" /> + </copyfilelist> + </target> + <!-- }}} --> + <!-- ##################################### --> <!-- ### {{{ CLEAN ### --> *************** *** 65,69 **** <!-- ### {{{ PREPARE ### --> <!-- ##################################### --> ! <target name="prepare"> <mkdir dir="${build.dir}/WEB-INF/classes" /> <mkdir dir="${build.dir}/WEB-INF/lib" /> --- 98,102 ---- <!-- ### {{{ PREPARE ### --> <!-- ##################################### --> ! <target name="prepare" depends="generate.dependency.path"> <mkdir dir="${build.dir}/WEB-INF/classes" /> <mkdir dir="${build.dir}/WEB-INF/lib" /> *************** *** 98,101 **** --- 131,159 ---- </copy> + <!-- copy struts and dependencies because it is needed to be declared locally for some reason... --> + <dependencylist componentDescriptor="${carrot2.cvs.dir}/lib/struts.dep.xml" + fileListId="struts.dep.flist"> + <dependencies dir="${carrot2.cvs.dir}/lib"> + <include name="*.dep.xml" /> + </dependencies> + </dependencylist> + + <mkdir dir="${build.dir}/WEB-INF/lib" /> + <copyfilelist todir="${build.dir}/WEB-INF/lib"> + <filelist refid="struts.dep.flist" /> + </copyfilelist> + + <dependencylist componentDescriptor="${carrot2.cvs.dir}/lib/put-utils.dep.xml" + fileListId="struts.dep.flist"> + <dependencies dir="${carrot2.cvs.dir}/lib"> + <include name="*.dep.xml" /> + </dependencies> + </dependencylist> + + <mkdir dir="${build.dir}/WEB-INF/lib" /> + <copyfilelist todir="${build.dir}/WEB-INF/lib"> + <filelist refid="struts.dep.flist" /> + </copyfilelist> + </target> <!-- }}} --> *************** *** 113,119 **** includeantruntime = "false" includejavaruntime = "false" - classpathref = "compile.classpath" > ! <!-- add source code paths. --> <src path="${src.path}" /> </javac> --- 171,177 ---- includeantruntime = "false" includejavaruntime = "false" > ! <classpath refid="classpath.dependencies" /> ! <classpath location="${carrot2.cvs.dir}/lib/compile-time-only/servlet.jar" /> <src path="${src.path}" /> </javac> *************** *** 153,157 **** </fileset> ! <lib dir="lib"> </lib> --- 211,216 ---- </fileset> ! <lib dir="${build.dir}/WEB-INF/lib"> ! <include name="*.jar" /> </lib> |