ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@gmx.net
Subject RE: Classpath
Date Tue, 28 Aug 2001 14:57:31 GMT
Hello Connor,
probably I have to explain in detail what I tried to do. In the following
you will find the build.xml I am using. 

I tried to use a path type to define the classpath dynamically in the
project. But this seems not to work like mentioned earlier. 

The problem is, that I would like to do this as generic as possible. I put
the marked statements also in a classpath task of javadoc, and it did not work
either. 

any ideas?

<project name="ess" basedir="." default="compile">

<!-- First solution -->
    <path id="jboss.class.path">
      <fileset dir="${jboss.lib.dir}">
        <include name="**/*.jar"/>
      </fileset>
    </path>

<!-- Second solution -->
    <path id="jboss.class.path">
      <fileset dir="${JBOSS_HOME}/lib">
        <include name="**/*.jar"/>
      </fileset>
    </path>

<!-- Third solution, this works -->
    <path id="jboss.class.path">
      <fileset dir="../jboss/lib">
        <include name="**/*.jar"/>
      </fileset>
    </path>



	<target name="init">

		<property name="build.compiler" value="jikes"/>

	<!-- Setting basic properties which are always needed -->
		<property name="project.name" value="timesheet"/>
		<property name="project.version" value="0.1"/>
		<property name="project.root" value="."/>

		<property name="jboss.dir" value="${JBOSS_HOME}"/>
		<property name="tomcat.dir" value="${TOMCAT_HOME}"/>

		<property name="jboss.lib.dir" value="${jboss.dir}/lib"/>
		<property name="jboss.ext.lib.dir" value="${jboss.lib.dir}/ext"/>
		<property name="jboss.client.lib.dir" value="${jboss.dir}/client"/>
		<property name="tomcat.lib.dir" value="${tomcat.dir}/lib"/>

		<property name="dest.dir" value="./dist"/>

		<property name="dest.lib.dir" value="${dest.dir}/lib"/>
		<property name="src.ejb.dir" value="./src/ejb"/>
		<property name="generate.ejb.dir" value="./generated"/>
		<property name="src.srvl.dir" value="./src/servlet"/>

		<property name="src.ejb.jar" value="${basedir}/META-INF"/>
		<property name="dest.ejb.jar" value="${basedir}/ejb-jars"/>
		<property name="src.srvl.war" value="${basedir}/WEB-INF"/>
		<property name="dest.srvl.war" value="${basedir}/srvl-wars"/>
		<property name="ejb.doclet" value="${lib.dir}/ejbdoclet.jar"/>
		
		<property name="ejb.packages"
value="com.think4you.ess.timesheet.ejb.session,
											 com.think4you.ess.timesheet.ejb.entity"/>
											 
		<!-- EAR KOMMT NOCH.... -->
	</target>

	<target name="generate_ejb" depends="init">
		<mkdir dir="${generate.ejb.dir}"/>
		<!-- Generating the EJBs using EJBDoclet -->
		<javadoc packagenames="${ejb.packages}"
             		sourcepath="${src.ejb.dir}"
             		classpath="${java.class.path}">
      		<doclet name="com.dreambean.ejbdoclet.EJBDoclet"
              		path="./lib/ejbdoclet.jar">
          		<param name="-name" value="Employee Self Services" />
          		<param name="-d" value="${generate.ejb.dir}" />
      		</doclet>
    	</javadoc>
	</target>

	<target name="compile_ejb" depends="generate_ejb">
		<mkdir dir="${dest.dir}"/>
		<mkdir dir="${dest.lib.dir}"/>

		<javac srcdir="${src.ejb.dir}" destdir="${dest.lib.dir}" 
				debug="true" 
				deprecation="false">

			<classpath>
				<pathelement path="${java.class.path}/"/>
        	</classpath>	

		</javac>
		<javac srcdir="${generate.ejb.dir}" destdir="${dest.lib.dir}" 
				debug="true" 
				deprecation="false">

			<classpath>
				<pathelement path="${java.class.path}/"/>
        	</classpath>	

		</javac>
	</target>

	<target name="compile_srvl" depends="init, compile_ejb">
		<javac srcdir="${src.srvl.dir}" destdir="${dest.lib.dir}" 
				debug="true" 
				deprecation="false">

			<classpath>
				<pathelement path="${java.class.path}/"/>
				<pathelement location="${dest.lib.dir}"/>
        	</classpath>	
				
		</javac>
	</target>
	
	<target name="compile" depends="init, compile_ejb, compile_srvl"/>

	<target name="ejb_jar" depends="init, compile_ejb">
		<jar jarfile="timesheetSession.jar" basedir="./com/think4you/ess" 
			 compress="true" 
			 includes="./META-INF/**"/>
	</target>
	
	<target name="clean" depends="init">
		<delete dir="${dest.dir}"/>
	</target>
	
	<target name="clean_all" depends="init, clean">
		<delete dir="${generate.ejb.dir}"/>
	</target>
	
	
</project>




From: <mmay@gmx.net>
> Hello,
>
> currently I am trying to generate my classpath pretty dynamically with
ant.
> up until now i tried to use the path-type as well as filesets. But the
> problem seems, that i do not have access to some properties when setting
this
> stuff.

Markus, you'll have to elaborate on what you mean by "i do not have access
to some properties". Build file snippets, supporting info, etc needed
before we can help you.


>
> any experiences?

Some.

Conor


-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net



Mime
View raw message