comp.lang.ada
 help / color / mirror / Atom feed
From: Phil Thornley <phil.jpthornley@gmail.com>
Subject: Re: Question about GNAT project files.
Date: Tue, 28 Feb 2012 06:56:52 -0000
Date: 2012-02-28T06:56:52+00:00	[thread overview]
Message-ID: <MPG.29b68b0bdc3264898968e@news.zen.co.uk> (raw)
In-Reply-To: hfSdnUg7kIRPqNHSRVn_vwA@giganews.com

In article <hfSdnUg7kIRPqNHSRVn_vwA@giganews.com>, PChapin@vtc.vsc.edu 
says...
> 
> On 2012-02-27 08:08, Ludovic Brenta wrote:
> 
> > I would keep the library project file unchanged and create one project
> > file for both the tests and the benchmark:
> >
> > with "lib.gpr";
> > project Main is
> >     for Source_Dirs use ("tests", "benchmarks");
> >     for Main use ("test", "benchmark");
> > end Main;
> >
> > You load main.gpr in GPS.
> 
> I set this up and it basically works fine... which is great. I do have 
> one quirk though. My library has some SPARK components. When I load 
> lib.gpr directly I can run the Examiner from inside GPS fine. It uses a 
> command line that looks, in part, like
> 
> spark -index_file=lib.idx ...
> 
> This works because the SPARK index file (lib.idx) is in the same folder 
> as the project file (lib.gpr). However, when I load my main project file 
> as defined above and then try to run the Examiner on a file in the lib 
> subproject it does not work. The command above is issued but the 
> Examiner complains that it can't open the file lib.idx. I suspect that 
> the working folder is the one containing main.gpr and not the one 
> containing lib.gpr.
> 
> It seems like, ideally, GPS should change to the folder of the 
> subproject before issuing commands defined as external tools over that 
> project. I don't see a way to make it do this. Perhaps this is a problem 
> with the GPS/SPARK integration. Maybe I could fix it myself by tinkering 
> with the Python files of the appropriate plug-in. However, before 
> attempting something like that I thought I'd ask here to see if there's 
> a better way.
> 
> Right now to use SPARK on my library I need to load the lib.gpr file 
> directly. That's not the end of the world, but it's also not everything 
> I had hoped for.

Try adding:

   package Ide is
      for Default_Switches ("examiner")
        use ("-index_file=<path to project folder>lib.idx");
   end Ide;

to main.gpr.  This should override the index file defined in lib.gpr.

Cheers,

Phil




  reply	other threads:[~2012-02-28  6:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-26 19:48 Question about GNAT project files Peter C. Chapin
2012-02-26 20:15 ` Dmitry A. Kazakov
2012-02-26 22:18 ` Greg Moncreaff
2012-02-27 13:41   ` Peter C. Chapin
2012-02-28 16:59     ` Yannick Duchêne (Hibou57)
2012-02-28 18:10       ` AdaMagica
2012-02-28 18:14       ` Simon Wright
2012-02-27 13:08 ` Ludovic Brenta
2012-02-27 13:43   ` Peter C. Chapin
2012-02-27 15:27   ` Simon Wright
2012-02-28  2:02   ` Peter C. Chapin
2012-02-28  6:56     ` Phil Thornley [this message]
2012-02-29  0:04       ` Peter C. Chapin
2012-02-29  9:18         ` Phil Thornley
2012-02-29 14:51           ` Peter C. Chapin
2012-02-29 16:49             ` Phil Thornley
2012-02-29 17:17               ` Peter C. Chapin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox