ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <vinod.na...@iflexsolutions.com>
Subject RE: <ejbjar> task
Date Tue, 08 Jun 2004 08:43:24 GMT
Hi Neta,

I am pasting some part of build.xml where I implemented this sort of
functionality. Hope this would help you.

  <taskdef name="scriptdef"
classname="org.apache.tools.ant.taskdefs.optional.script.ScriptDef"/>

  <!-- This scriptlet splits 'bean-name=<BeanName>' such that a property
'bean-name' is assigned a value 'BeanName' -->
  <scriptdef name="SplitBeanInfo" language="javascript">
	<attribute name="beanset"/>
    <![CDATA[
	
project.setProperty(attributes.get("beanset").substring(0,attributes.get
("beanset").indexOf("=")),attributes.get("beanset").substring(attributes
.get("beanset").indexOf("=")+1,attributes.get("beanset").length()));
    ]]>
  </scriptdef>

  <!-- ==============================================================
-->
  <!-- Creates Entity Bean jar files.
-->
  <!-- Information of each E-Bean is separated by $ sign.
-->
  <!-- bean-name and bean-code info of each E-Bean are separated by ','
sign.		   -->
  <!-- ===============================================================
-->

	<target name="EntityBeans" if="e-beans">
		<for list="${e-beans}" delimiter="$" param="ebean-set">
		<sequential>
			<for list="@{ebean-set}" delimiter=","
param="beaninfo">	
			<sequential>
				<SplitBeanInfo beanset="@{beaninfo}"/>
			</sequential>
			</for>
			<antcall target="E-Bean"/>
		</sequential>
		</for>
	</target>
  
  <!-- ================================================================
-->
  <!-- Creates an Entity bean. This is recursively called by EntityBeans
target.		   -->
  <!-- bean-name and bean-code are the 2 inputs needed by this terget.
-->
  <!-- ================================================================
-->

    <target name="E-Bean">

	<!-- Bean properties -->
	<property name="source" value="${src.pkg}/db/${bean-code}"/>
	<property name="build" value="${source}/build"/>
	<property name="in_jar" value="${bean-name}EBeanIn.jar"/>
	<property name="out_jar" value="${bean-name}EBeanOut.jar"/>

	<delete dir="${build}"/>
	<mkdir dir="${build}"/>

	<mkdir dir="${build}/META-INF"/>
	<copy todir="${build}/META-INF">
		<fileset dir="${source}/META-INF"/>
	</copy>

	<javac srcdir="${source}" destdir="${build}" includes="*.java">
		<classpath>
			<pathelement path="${weblogic.classpath}"/>
		</classpath>
	</javac>

	<jar jarfile="${source}/${in_jar}" basedir="${build}" />

	<java classname="weblogic.ejbc" fork="yes">
		<arg line="-compiler javac -J-ms128m -J-mx512m
${source}/${in_jar} ${source}/${out_jar}"/>
		<classpath>
			<pathelement path="${weblogic.classpath}"/>
		</classpath>
	</java>

	<copy todir="${EJB_CLASS_HOME}/com">
		<fileset dir="${source}/build/com">
			<exclude name="**/*Bean.class"/>
		</fileset>
	</copy>

	<copy  file="${source}/${out_jar}" todir="${deploy-apps}/" />

	<delete dir="${build}"/>

  </target>

And this is where I pass the input thru some .properties file.
#######################################
#making entity beans
#######################################
e-beans=bean-name=Rco,bean-code=rco$bean-name=Rems,bean-code=rems

Regards,
Vinod.


-----Original Message-----
From: Neta Bar Tal [mailto:NETAB@Amdocs.com] 
Sent: Tuesday, June 08, 2004 1:37 PM
To: user@ant.apache.org
Subject: <ejbjar> task


Hi All,
can I have more than one descriptor dir to pass to <ejbjar>. how can I
do it with ant variable?


thanks
netaB






The information contained in this message is proprietary of Amdocs,
protected from disclosure, and may be privileged.
The information is intended to be conveyed only to the designated
recipient(s)
of the message. If the reader of this message is not the intended
recipient,
you are hereby notified that any dissemination, use, distribution or
copying of

this communication is strictly prohibited and may be unlawful.

If you have received this communication in error, please notify us
immediately
by replying to the message and deleting it from your computer.
Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message