ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barrie Treloar <>
Subject RE: Get emacs to find the correct build.xml and automatically pas s it to ant.
Date Thu, 19 Oct 2000 00:29:17 GMT
On Wed, 18 Oct 2000, Jose  Alberto Fernandez wrote:

> Barry hi,
> I am trying to use your prj.el file for our builds, but since we use CVS
> and every developer may have checkout the source in a different directory,
> I wonder if it is possible to specify the location of the build file
> relative
> to prj.el itself.
> My idea is to checkin on CVS "<TOP>/prj.el" and let then specify the
> buildfile
> relative to this location.
> Any ideas how to do this?


> > ; The location of the Ant build file.
> > (make-local-variable 'jde-make-args)
> > (setq jde-make-args "-f <TOP>/build.xml")

I dont believe it is possible to specify it relative to the location
prj.el file because of the above variable value.

jde-make-args is simply appended to jde-make-program to form the
command that jde will run to invoke your build.

Therefore you will get "ant -f <relative path>/build.xml" and this
will most likely use current working directory of the emacs process as
the place to start evaluating the relative path name.

I find this resource to be invaluable when hacking emacs.  My brain is
not well formed at supporting lisp so I look up all the information I
need when I need it.

We have two choices in solving this problem.  We can use an
environment variable for storing the location of TOP or we can use an
emacs variable for storing TOP.  We can then concatenate the two
strings together in the prj.el file to specify the correct location.

I would be suggesting the use of emacs variables so they can be
quickly changed and so they dont pollute your shell variable space.

So for a project name project-x we can create an emacs variable called
project_x_top which defines the developers local location of the
source tree.

In each developers .emacs file include:

        ;; The per developer location of the source tree for project-x
        (setq project_x_top "<TOP>")

In the prj.el file change 

        (setq jde-make-args "-f <TOP>/build.xml")
        ;; The build file for project-x lives at <TOP>/build.xml 
        ;; where TOP for project-x is stored in the project_x_top variable
        (setq jde-make-args (concat "-f " project_x_top "/build.xml") )       

This will concatenate the strings together to include the value of
project_x_top to correctly point to the per developer location.

Hope this helps.
Barrie Treloar

  Barrie Treloar                      Phone: +61 8 8303 3300
  Senior Analyst/Programmer           Fax:   +61 8 8303 4403 
  Electronic Commerce Division        Email:
  Camtech (SA) Pty Ltd      
 --- Level 8, 10 Pulteney Street, Adelaide SA 5000, Australia. ---

View raw message