Ok, 

Can I execute a os command and get the result into a property? cause
hostname would be an ideal solution as on NT is returns a lower case
hostname.

Thanks

Mick

-----Original Message-----
From: M.A.Dunphy [mailto:[EMAIL PROTECTED]]
Sent: 12 March 2001 17:50
To: '[EMAIL PROTECTED]'
Subject: RE: Creating a p4 client workspace


and the plot thickens..

I've taken the assumption that the hostname will be in an environment
variable. Now for the good bit, on NT this gives the hostname in uppercase
and when used in a p4 clientworkspace, p4 complains that I'm not running
from that host.

I may come to like p4 but at the moment I'm finding it a complete and utter
plain. ;-)

-----Original Message-----
From: Diane Holt [mailto:[EMAIL PROTECTED]]
Sent: 12 March 2001 17:30
To: [EMAIL PROTECTED]
Subject: RE: Creating a p4 client workspace


The 'ant' and 'ant.bat' scripts allows or an "rc" file to be read in, if
one exists in the user's home dir, so you could have the host name
determined and set in the rc file (eg., "export HOST=`hostname`"), then
pass that value on the "$JAVACMD ..." line, or use the new "env"
functionality of <property> and access the value that way.

Diane

--- Kevin O'Regan <[EMAIL PROTECTED]> wrote:
> another platform specific hack?
> 
> java -Dhost.name=%COMPUTERNAME% ... org.apache.tools.ant.Main etc
> 
> regards
> 
> Kevin
> 
> > -----Original Message-----
> > From: M.A.Dunphy [mailto:[EMAIL PROTECTED]]
> > Sent: 12 March 2001 16:35
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: Creating a p4 client workspace
> > 
> > 
> > Kevin
> > 
> > PS:
> > 
> > how are you setting the variable ${host.name}?
> > 
> > Thanks
> > 
> > 
> > 
> > -----Original Message-----
> > From: Kevin O'Regan [mailto:[EMAIL PROTECTED]]
> > Sent: 12 March 2001 15:42
> > To: [EMAIL PROTECTED]
> > Subject: RE: Creating a p4 client workspace
> > 
> > 
> > > I'm trying to create a client workspace without invoking the 
> > > editor. So
> > > first I define the settings for the workspace in a file and 
> > > then I invoke p4
> > > to create the workspace, but it is failing for the reason 
> > shown below:
> > > 
> > >      [exec] Myos = Windows 2000
> > >      [exec] p4 client -i <
> > > C:\DOCUME~1\mdunphy\LOCALS~1\Temp\p4clientworkspace.txt
> > > Execute:Java13CommandLauncher: p4 client -i <
> > > C:\DOCUME~1\mdunphy\LOCALS~1\Temp\p4_clientworkspace.txt
> > >      [exec] Usage: client -i [ -f ]
> > >      [exec] Unexpected arguments.
> > >      [exec] Result: 1
> > > 
> > > the exec task is shown below:
> > > 
> > >         <exec executable="p4">
> > >             <arg line="client -i &lt; ${p4.client.workspace}"/>
> > >         </exec>
> > 
> > The only solution I found was to create a batch file that takes the
> > clientname and calls p4 
> > 
> > i.e. mkClient.bat
> > 
> > p4 -c%1 client -i<%2
> > 
> > and takes the client name and description from ant.
> > 
> > i.e.
> > 
> >     <target name="create_tmp_client">
> >             <mkdir dir="${logs}"/>
> >             <copy file="${Misc.Files}\default.client"
> > tofile="${logs}\p4client" overwrite="yes"/>
> >             <replace file="${logs}\p4client" 
> > token="@Perforce.Client@"
> > value="ant-${user.name}-${host.name}"/>
> >             <replace file="${logs}\p4client" token="@Perforce.Root@"
> > value="${basedir}"/>
> >             <replace file="${logs}\p4client" token="@User.Name@"
> > value="ant-${user.name}"/>
> >             <exec dir="${basedir}" executable="p4.exe"
> > output="${logs}\p4clientcreate.txt">
> >                     <arg 
> > line="-c$ant-${user.name}-${host.name} client
> > -o"/>
> >             </exec>
> >             <exec dir="${basedir}"
> > executable="${Misc.Files}\mkClient.bat" 
> > output="${logs}\p4clientmodify.txt">
> >                     <arg value="$ant-${user.name}-${host.name}"/>
> >                     <arg value="${logs}\p4client"/>
> >             </exec>
> >     </target>
> > 
> > regards
> > 
> > Kevin
> > 
> > KeyTools Java Development.
> > Baltimore Technologies.
> > 
> > 
> > --------------------------------------------------------------
> > --------------
> > -
> > Baltimore Technologies plc will not be liable for direct,  special,
> > indirect 
> > or consequential  damages  arising  from  alteration of  the 
> > contents of
> > this
> > message by a third party or as a result of any virus being passed on.
> > 
> > In addition, certain Marketing collateral may be added from 
> > time to time to
> > promote Baltimore Technologies products, services, Global 
> > e-Security or
> > appearance at trade shows and conferences.
> > 
> > This footnote confirms that this email message has been swept by
> > Baltimore MIMEsweeper for Content Security threats, including
> > computer viruses.
> >    http://www.baltimore.com
> > 
> > 
> > This footnote confirms that this email message has been swept by
> > MIMEsweeper for the presence of computer viruses.
> > 


=====
([EMAIL PROTECTED])



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

Reply via email to