ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Blanc <Sebastien.Bl...@alcatel.com>
Subject Re: How to use properties iteration?
Date Wed, 28 May 2003 15:37:51 GMT
u have to specify jython directly if u do the following. see
http://www.lonsteins.com/articles/jython-bsf.html
seb.

        1.In the build.xml file for BSF add the lines:
                <available property="jython.present"
classname="org.python.util.PythonInterpreter"/>
                <target name="checkJython" unless="jython.present">
                   <echo message="Warning: Jython dependencies were not
resolved."/>
                </target>
           Remove the lines with references to "JPython" since they will
conflict with the "Jython" components.
        2.Edit the Languages.properties file in the subdirectory
/build/src/com/ibm/bsf of your BSF source directory adding:
                jython = com.ibm.bsf.engines.jython.JythonEngine, py
           Again, remove the lines referring to "JPython".
        3.Rename thejpython directory in /src/com/ibm/bsf/engines/ to
jython.
        4.Rename the Jpython.Engine file to Jython.Engine.
        5.Edit the newly renamed file and globally replace 'Jpython'
with 'Jython', making sure that the class name matches the filename.
Save the file.
        6.From a command prompt, go to the directory containing your BSF
sources and execute the command 'ant'.
           This will build the BSF classes and assemble them into a .jar
file.

"Verma, Nitin (GECP, OTHER, 529706)" wrote:

>  Now I was able to reach ftp://www-126.ibm.com/ ... but still I get
> the same error! "com.ibm.bsf.BSFException: unsupported language:
> jython"Help!
>
>      -----Original Message-----
>      From: Verma, Nitin (GECP, OTHER, 529706)
>      Sent: Wednesday, May 28, 2003 7:30 PM
>      To: Ant Users List
>      Subject: RE: How to use properties iteration?
>
>
>
>
>      ftp://www-126.ibm.com/ is down ... I think
>      So I get a jar from
>      http://xml.apache.org/dist/soap/version-2.2/ !
>
>
>      Now I get
>      "file:E:/projects/ts/serverconfig/serverconfig-appinstance/classpath.xml:13:
>      com.ibm.bsf.BSFException: unsupported language: jython"
>
>      Can you please mail me the write version please!
>
>      -----Original Message-----
>      From: peter reilly [mailto:peter.reilly@corvil.com]
>      Sent: Wednesday, May 28, 2003 6:57 PM
>      To: Ant Users List
>      Subject: Re: How to use properties iteration?
>
>      On Wednesday 28 May 2003 14:16, Verma, Nitin (GECP, OTHER,
>      529706) wrote:
>      > Thanx so much ... but I get "Could not create task or type
>      of type:
>      > script."
>      >
>      > Do I need some *.jar files for jpython?
>
>      You need bsf.jar from ibm and jython.jar from jython.org -
>      check the ant manual. -
>
>      For ant 1.6 and above, bsf.jar comes from apache.
>
>      (I am using ant 1.6 alpha with bsf.jar)
>
>      Peter
>      >
>      > -----Original Message-----
>      > From: peter reilly [mailto:peter.reilly@corvil.com]
>      > Sent: Wednesday, May 28, 2003 6:43 PM
>      > To: Ant Users List
>      > Subject: Re: How to use properties iteration?
>      >
>      >
>      > You need to use <script/>
>      >
>      > Here is an example with jython:
>      >
>      > <project name="t" default="t">
>      >   <target name="t">
>      >     <concat destfile="x.properties">
>      > jar.1.name = telnet
>      > jar.telnet.location=/home/my
>      > jar.telnet.version = 1.0
>      > jar.2.name = ssh
>      > jar.ssh.location=/home/his
>      > jar.ssh.version = 1.2
>      >     </concat>
>      >     <property file="x.properties"/>
>      >     <script language="jython">
>      > import java.util.TreeMap as TreeMap
>      > import java.lang.Integer as Integer
>      > sorted = TreeMap()
>      > props  = project.getProperties()
>      > for x in props.keys():
>      >     if x.find("jar") == 0 and x.find("name") != -1:
>      >         num = x[4:x.find("name")-1]
>      >         sorted.put(Integer.decode(num), props.get(x))
>      >         print x
>      >         print num
>      > result = ""
>      > for x in sorted.keySet():
>      >     name = sorted.get(x)
>      >     location=props.get("jar." + name + ".location")
>      >     version=props.get("jar." + name + ".version")
>      >     if result != "":
>      >         result = result + ":"
>      >     result = result + location + "/" + name + "-" +
>      version + ".jar"
>      > project.setUserProperty("my.classpath", result)
>      >     </script>
>      >
>      >     <echo message="CP is ${my.classpath}"/>
>      >   </target>
>      > </project>
>      >
>      > Peter
>      >
>      > On Wednesday 28 May 2003 13:36, Verma, Nitin (GECP, OTHER,
>      529706) wrote:
>      > > I can have n number of jars, so:-
>      > >
>      > > I need to have something like this:
>      > >
>      > > <!--I don't know how to make while loop using ant -->
>      > > <while condition="true">
>      > >     <property name="jar.name" value="java.${i}.name"/>
>      > > <!--I don't know how to do this using ant -->
>      > >     <if condition="${jar.name} == null">
>      > >         <break/>
>      > >     </if>
>      > > <!--
>      ----------------------------------------------------- -->
>      > >     <property name="jar.version"
>      value="jar.${jar.name}.version"/>
>      > >     <property name="jar.location"
>      value="jar.${jar.name}.location"/>
>      > >     <property name="jar.path"
>      > > value="${jar.location}/${jar.name}-${jar.version}.jar"/>
>
>      > >     <property name="classpath" append="jar.path"/> <!--
>      I need to append
>      >
>      > to
>      >
>      > > a property, I don't know how to do this?-->
>      > > <!-- who to do "i++"? -->
>      > > </while>
>      > > <!--
>      ----------------------------------------------------- -->
>      > >
>      > > Help please!
>      > >
>      > > Regards,
>      > >
>      > > Nitin Verma
>      > >
>      > >  -----Original Message-----
>      > > From: Manoj Sadangi [mailto:msadangi@manh.com]
>      > > Sent: Wednesday, May 28, 2003 5:46 PM
>      > > To: 'Ant Users List'
>      > > Subject: RE: How to use properties iteration?
>      > >
>      > >
>      > >
>      > > load the properties file
>      > > and you can access the properties and construct the path
>      like
>      > > ${jar.telnet.location}/${jar.1.name }/......
>      > >
>      > >
>      > >
>      > > thanks,
>      > > manoj
>      > >
>      > >
>      > >  -----Original Message-----
>      > > From: Verma, Nitin (GECP, OTHER, 529706)
>      [mailto:NITIN.VERMA@APPL.GE.COM]
>      > > Sent: Wednesday, May 28, 2003 7:57 AM
>      > > To: Ant Users List
>      > > Subject: How to use properties iteration?
>      > >
>      > >
>      > >
>      > > Hi All,
>      > >
>      > >         I have properties like:
>      > >                 jar.1.name = telnet
>      > >                 jar.telnet.location=/home/my
>      > >                 jar.telnet.version = 1.0
>      > >                 jar.1.name = ssh
>      > >                 jar.ssh.location=/home/his
>      > >                 jar.ssh.version = 1.2
>      > >
>      > >         Now I need to make a path like:-
>      > >
>      > >
>      /home/my/telnet-1.0.jar:/home/his/ssh-1.2.jar
>      > >
>      > > Can someone help me on this?
>      > >
>      > > Regards,
>      > >
>      > > Nitin Verma
>      >
>      >
>      ---------------------------------------------------------------------
>
>      > 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
>
>    ----------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message