ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot P. Floess" <sflo...@nc.rr.com>
Subject Re: How to get varaibles recognized by this task
Date Thu, 05 Mar 2009 18:56:42 GMT

Here is an example of my being able to compute the locale of the currently 
running JVM and store it in a property using beanshell as my scripting 
language:

     <scriptdef
         name        = "compute-locale"
         language    = "beanshell"
         description = "Sets the locale of the current JVM."
         uri         = "http://keros.sourceforge.net" >

         <classpath>
             <fileset  dir = "${keros.dependency.HOME}"  includes = 
"*.jar"/>
         </classpath>

         <attribute  name = "property"/>

         <![CDATA[
             project.setProperty ( attributes.get ( "property" ), 
java.util.Locale.getDefault ().toString () );
         ]]>
     </scriptdef>


On Thu, 5 Mar 2009, dave.alvarado@remanresource.com wrote:

> Thanks for your reply.  I'm unfamiliar with some of the terms you are mentioning below.
 Could you give a code example?
>
> - Dave
>
>
>>  -------Original Message-------
>>  From: Scot P. Floess <sfloess@nc.rr.com>
>>  Subject: Re: How to get varaibles recognized by this task
>>  Sent: Mar 05 '09 17:24
>>
>>
>>  I know, at least using scriptdef, I was able to make calls out to
>>  attributes.get ( [attribute-name] ) using beanshell - of course assuming
>>  my scriptdef contained an <attribute  name = "attribute-name"/> element
>>
>>  On Thu, 5 Mar 2009, dave.alvarado@remanresource.com wrote:
>>
>> > Hi,
>> >
>> > I have the below target ...
>> >
>> > 	 <target name="deploy" depends="copy-war">
>> > 	 	 <taskdef name="wlst" classname="weblogic.ant.taskdefs.management.WLSTTask"
/>
>> > 	 	 <wlst debug="true" failOnError="true"
>> >      	 	 executeScriptBeforeFile="false"
>> >      	 	 fileName="./wls_scripts/wls922_definitions.py"
>> >    	 	 arguments="${wlsuser} ${wlspwd} ${wlshosturl} "
>> >      	 >
>> > 	       <script>
>> > print 'Calling the script ...'
>> > connect(sys.argv[1],sys.argv[2],sys.argv[3])
>> > shutdownCluster("my_cluster_1")
>> > undeploy("RoutingEngine#v1.0")
>> > removeApplication("RoutingEngine#v1.0")
>> > deploy('RoutingEngine#v1.0', '/opt/wars/routing_engine_wars/RoutingEngine.war',
targets='my_cluster_1' )
>> > startCluster("my_cluster_1")
>> > disconnect()
>> >        </script>
>> > 	    </wlst>
>> > 	 </target>
>> >
>> > Problem is, if I try and put in variables within the "<script>" segment,
for example
>> >
>> > removeApplication("${projectName}#v1.0")
>> >
>> > They are literally interpreted.  So the above tries to remove the application,
"${projectName}#v1.0".  How can I get my variables passed to this?  I hate having to hard
code things.
>> >
>> > Thanks, - Dave
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> > For additional commands, e-mail: user-help@ant.apache.org
>> >
>> >
>>
>>  Scot P. Floess
>>  27 Lake Royale
>>  Louisburg, NC  27549
>>
>>  252-478-8087 (Home)
>>  919-754-4592 (Work)
>>
>>  Chief Architect JPlate   http://sourceforge.net/projects/jplate
>>  Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
>>
>>  Architect Keros          http://sourceforge.net/projects/keros
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>  For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

Mime
View raw message