comp.lang.ada
 help / color / mirror / Atom feed
From: Per Sandberg <per.s.sandberg@bahnhof.se>
Subject: Re: Suggestion about best practice with .gpr files
Date: Mon, 31 May 2021 22:14:44 +0200	[thread overview]
Message-ID: <VsbtI.3946$ea3.1814@fx10.ams1> (raw)
In-Reply-To: <f6b41bac-39d2-441d-a89d-3485bf3fa99bn@googlegroups.com>

Well that's the way I have been doing it for 20+ years with some small 
twists.
GPR_PROJECT_PATH points here:
!foolib/
!...|
!...+-- foolib.gpr
!...+-- src/
!........|foolib.ads
!...+-- lib/
!...+-- .obj/
!...+-- test/
!..........|
!..........+--foolib-test.gpr
!..........+-- .obj/
!..........+-- bin/
!..........+-- src/
!................|
!...............+-- foolib-tests-test_1.adb
!...............+-- foolib-tests-test_2.adb
!...............+-- foolib-tests-test_3.adb
!foxlib/
!application1/
!application2/

Then the experience i quite similar to what you get with an "eclipse 
workspace".
But with the capability to a lot of other structural exercises, such as 
having a baseline ReadOnly workspace and then using GPR_PROJECT_PATH to 
point first to a private workspace and then the baseline.

/Persan

On 30/05/2021 19:37, mockturtle wrote:
> Dear.all,
> I have a problem that I solved in a fairly acceptable way, but I would like to hear from you if there are some kind of "better practices" that I could use.
> 
> The problem is this: sometimes, while writing some software, I develop some packages that could be used elsewhere, so I "extract" them in a library of their own with their own project file that is "with-ed" inside the project file of the larger software.
> 
> When I "isolate" the package into its own library,  I like also to add some testing code.  The problem is that if I declare the project to be a library project (which is just natural) I cannot have an executable.
> 
> In the past, I solved this problem by declaring the project to be a non-library one; nowadays I declare it to be a library project and then add a folder test/ with its src/ folder with the test programs and a specific project file that "with-s" the library project.
> 
> Let me try drawing a picture relative to a library "foo"
> 
> foolib/
> ...|
> ...+-- foolib.gpr
> ...+-- src/
> ...+-- obj/
> ...+-- test/
> ..........|
> ..........+--foolib_test.gpr
> ..........+--obj/
> ..........+--src/
> ................|
> ...............+-- foo_test_1.adb
> ...............+-- foo_test_2.adb
> ...............+-- foo_test_3.adb
> 
> I hope you got the idea.
> 
> Do you have any suggestion about a different organization?  Do there exist some kind of "best practice" for this?
> 
> Thank you in advance for your help
> 
> Riccardo
> 

      parent reply	other threads:[~2021-05-31 20:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-30 17:37 Suggestion about best practice with .gpr files mockturtle
2021-05-30 17:46 ` Stephen Leake
2021-05-30 19:31   ` Simon Wright
2021-05-30 17:56 ` Dmitry A. Kazakov
2021-05-30 20:22 ` Jeffrey R. Carter
2021-05-31  7:42   ` AdaMagica
2021-05-31 16:59     ` Stephen Leake
2021-06-01  9:33       ` Jeffrey R. Carter
2021-06-04  7:48         ` Björn Lundin
2021-06-04  8:14           ` Dmitry A. Kazakov
2021-06-04  9:18           ` Jeffrey R. Carter
2021-06-04  9:47             ` Björn Lundin
2021-06-04 12:52           ` Simon Wright
2021-06-04 14:53             ` Björn Lundin
2021-06-01 14:38   ` Shark8
2021-05-31 15:02 ` Maxim Reznik
2021-05-31 17:07   ` Stephen Leake
2021-05-31 20:14 ` Per Sandberg [this message]
replies disabled

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