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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,80155a886d197693 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!18g2000yqa.googlegroups.com!not-for-mail From: Chrono Newsgroups: comp.lang.ada Subject: Re: Conditional Compilation in Ada Date: Tue, 30 Jun 2009 03:41:34 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5977b4ec-d5d4-40a1-a58a-d494eec21d27@18g2000yqa.googlegroups.com> References: <5618a901-6b05-4a60-8362-7821261da50b@f19g2000yqo.googlegroups.com> <768c8117-d8af-4a04-b27e-2e74b69c1e8b@y17g2000yqn.googlegroups.com> <15ce8441-af38-4498-b3ed-c0517ad87dc6@x3g2000yqa.googlegroups.com> NNTP-Posting-Host: 201.7.145.1 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246358497 19807 127.0.0.1 (30 Jun 2009 10:41:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 30 Jun 2009 10:41:37 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 18g2000yqa.googlegroups.com; posting-host=201.7.145.1; posting-account=n9Sa1woAAACZc_iwSjaEkj9Lnt-XVrSr User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6749 Date: 2009-06-30T03:41:34-07:00 List-Id: On 29 jun, 17:02, sjw wrote: > On Jun 29, 7:00=A0pm, Chrono wrote: > > > Well, creating folders for each scenario is definitely not a better > > solution than using a prep script, mainly in a project with high > > complexity in its architecture. Even creating new packages for doing > > this (or new variables which are going to be compiled with main code), > > due to requirements restrictions. But thanks even though for all > > responses. > > Gosh, how many scenario variables do you have? with how many options? > I bet they don't actually affect that many actual code units, > especially if structured the way Dmitry suggests. > > You could use alternately-named bodies: > > project T is > =A0 type Environment is ("Real", "Simulated"); > =A0 Env : Environment :=3D external ("ENVIRONMENT"); > =A0 package Naming is > =A0 =A0 =A0case Env is > =A0 =A0 =A0 =A0 when "Real" =3D> > =A0 =A0 =A0 =A0 =A0 =A0for body ("Target.Get_Position") > =A0 =A0 =A0 =A0 =A0 =A0 =A0use "target-get_position_real.adb"; > =A0 =A0 =A0 =A0 when "Simulated" =3D> > =A0 =A0 =A0 =A0 =A0 =A0for body ("Target.Get_Position") > =A0 =A0 =A0 =A0 =A0 =A0 =A0use "target-get_position_simulated.adb"; > =A0 =A0 =A0end case; > =A0 end Naming; > end T; > > --S So let me explain... they are something like 5k files, each one with some 5k code lines. Anyway (and furthermore) by my team requirement, any optimization, even in development/coding level, even in run-time level, cannot be done with any creation of new files of folders. I can use gnat prepost as well, but what we already have been doing is a prep, so the number of steps doing this would be the same, and it does not worth doing. What I wanted is to change some directives in the code (which I could make a bash script for doing this easily) which already are there, but now relate them to scenarios watches, and as I choose Scenario "Thing" and make compile/build, GPS can identify automatically...'this part of code do not belong to this scenario "Thing", so I should not compile/build it with the whole project', and just ignore it: the idea is as we were hiding the prep phase, but the text codes do not change actually.