--- Rick Berman <[EMAIL PROTECTED]> wrote:
> For various reasons, we would like to have a target in
> our build that only builds a single java source file
> whose name the fully-qualified path name for that file
> and is provided via -Dvar command line argument.
[...]
> For instance, given:
>
> -Dfully.qualified.file=D:\a\b\src\dir\file.java
>
> <property name="src.base.dir" location="D:\a\b\src"/>
>
> How can I get the "dir\file.java" out of
> ${fully.qualified.file} to use in the includes
> attribute of the <javac> task? <basename> and
> <dirname> work on the whole path but I need to subset
> part of the path.
Two <dirname>'s and two <basename>'s:
<target name="getNames">
<dirname property="temp" file="${fully.qualified.file}"/>
<dirname property="dir" file="${temp}"/>
<basename property="subdir" file="${temp}"/>
<basename property="filename" file="${fully.qualified.file}"/>
<echo>dir = ${dir}</echo>
<echo>file to compile = ${subdir}${file.separator}${filename}</echo>
</target>
Diane
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>