ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: spaces in javac directories
Date Sat, 21 Sep 2002 01:36:55 GMT
Try replacing all these <property name/value/> for path/filenames with
<property name="" location=""/>, and forget about quoting things. Ant deals
with spaces just fine. For example:

<property name="javac.libs"
          location="/autobuild/projects/core/Version 3.2/build/java"/>

Also, don't confuse the includes/excludes attribute, which take a
comma-separated list of patterns, with <include/>/<exclude/> which take a
single pattern.

Build files normally reside in the project directory itself, and refer to
pieces of the project (source directory, destination dir for classes,
etc...) relatively. You seem to be using absolute paths, which is usually
not a good idea (suppose you want to build two CVS sandboxes, one for the
head, and one for the branch).

${env}.ANT_HOME should probably read ${env.ANT_HOME}, and is normally set by
the ant script itself (no need to set it).

<fileset> for your libs don't have any pattern, so recursively grabs all
files in the specified directories, whatever there type, which is not that
great. They probably don't need to be refided either, since defined in the
target itself as well.

These are many small issues you'd want to consider. I'd advise you to start
other with a much simpler target and <javac> task, in a build.xml local to
the project with a basedir of "." that uses only relative path (like <javac
srcdir="src/java"/>).

Hope this helps. --DD

-----Original Message-----
From: David Adams [mailto:DAdams@ignitesports.com]
Sent: Friday, September 20, 2002 2:16 PM
To: ant-user@jakarta.apache.org
Subject: spaces in javac directories


Hi,
I am trying to compile files from and back into a directory structure that
contains spaces, the actual task code follows. 

I have tried a number of different quoting methods ('" "', ' ', &quot;
&quot;, putting a \ in front of the space to escape). None of these methods
seem to work. 

Any ideas? 

	<target name="java.compile" description=" Java compilation task">
		<property name="javac.classes"
value="&quot;/autobuild/projects/core/Version 3.2/build/java/&quot;"/>
		<property name="javac.libs"
value="&quot;/autobuild/projects/core/Version 3.2/build/java/&quot;"/>
		<property name="javac.debug" value="on"/>
		<property name="javac.deprecation" value="on"/>
		<property name="javac.destdir"
value="&quot;/autobuild/projects/core/Version 3.2/build/java/&quot;"/>
		<property name="javac.excludes" value=""/>
		<property name="javac.includes" value="**/*.java"/>
		<property name="javac.fork" value="true"/>
		<property name="javac.includeAntRuntime" value="false"/>
		<property name="javac.includes" value=""/>
		<property name="javac.optimize" value="on"/>
		<property name="javac.packagenames" value="core.jar"/>
		<property name="javac.srcdir"
value="&quot;/autobuild/projects/core/Version 3.2/src/java/&quot;"/>
		<property name="javac.verbose" value="true"/>
		<property environment="env"/>
		<property name="ant.home" value="${env}.ANT_HOME"/>
		
		<fileset id="buildlibs" dir="${javac.libs}"/>

		<fileset id="locallibs" dir="${dir.local.lib}"/>
		
		<echo message="Compiling java project"/>
		<echo message="Compiling with debugging ${javac.debug}"/>
		<echo message="build.compiler-> ${build.compiler}"/>
		<echo message="javac.includes-> ${javac.includes}"/>
		<echo message="javac.excludes-> ${javac.excludes}"/>
		<echo message="javac.destdir-> ${javac.destdir}"/>
		<echo message="javac.srcdir-> ${javac.srcdir}"/>
		<echo message="javac.classes-> ${javac.classes}"/>
		<echo message="javac.packagenames-> ${javac.packagenames}"/>
		<echo message="dir.build.java-> ${dir.build.java}"/>

		<javac 
			debug="on"
			destdir="${javac.destdir}"
			srcdir="${javac.srcdir}"
			verbose="${javac.verbose}"
			optimize="${javac.optimize}"
			fork="${javac.fork}"
			includeAntRuntime="false"
			deprecation="${javac.deprecation}">
			<classpath>
				<pathelement location="${javac.classes}"/>
				<fileset refid="globallibs"/>
				<fileset refid="locallibs"/>
				<fileset refid="buildlibs"/>
			</classpath>
			<include name="${javac.includes}"/>
			<exclude name="${javac.excludes}"/>
		 </javac>
	</target>

Thanks in advance for the help.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Adams
Ignite Sports (www.ignitesports.com)
Voice: 773.293.4300
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--
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