ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: <javac> of single file via fully-qualified path name?
Date Tue, 20 Aug 2002 17:05:51 GMT
--- Rick Berman <noer2b@yahoo.com> 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

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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


Mime
View raw message