From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d13bf824aeeb7e2b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.154.143 with SMTP id o15mr1313817bkw.4.1330412216224; Mon, 27 Feb 2012 22:56:56 -0800 (PST) Path: t13ni78779bkb.0!nntp.google.com!news2.google.com!goblin3!goblin2!goblin.stu.neva.ru!feeder2.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!192.87.166.28.MISMATCH!tudelft.nl!txtfeed1.tudelft.nl!dedekind.zen.co.uk!zen.net.uk!hamilton.zen.co.uk!reader02.news.zen.co.uk.POSTED!not-for-mail From: Phil Thornley Newsgroups: comp.lang.ada Subject: Re: Question about GNAT project files. Date: Tue, 28 Feb 2012 06:56:52 -0000 Message-ID: References: Reply-To: phil.jpthornley@gmail.com MIME-Version: 1.0 User-Agent: MicroPlanet-Gravity/3.0.4 Organization: Zen Internet NNTP-Posting-Host: 23a2f72e.news.zen.co.uk X-Trace: DXC=Wb;f<@dfmZnWTR[NRY=YacYjZGX^207Pk` In article , 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=lib.idx"); end Ide; to main.gpr. This should override the index file defined in lib.gpr. Cheers, Phil