17 Commits

Author SHA1 Message Date
Jerome Lambourg
4ef839c85c Adjust tests after change of API for project loading. 2024-06-01 19:43:04 +02:00
Jerome Lambourg
fad3cdbaa1 Merge remote-tracking branch 'origin/master' into next 2024-01-11 23:48:01 +01:00
Jerome Lambourg
ba54406d43 Bump copyright notice to 2024
Also remove copyright from tests

no-issue-check
2024-01-10 11:11:21 +01:00
Jerome Lambourg
63d39d605a Bump copyright notice year
Also remove copyright headers from the testsuite, not applicable here.

no-issue-check
2024-01-09 17:59:32 +01:00
Jerome Lambourg
c73d17abc5 Continue cleanup and improve coverage
Add test for variable-reference of parent view.
Add test for erroneous cases in the build database.

Ref eng/gpr/gpr-issues#151
2023-12-12 23:16:13 +01:00
Jerome Lambourg
b7a1d9ad4b Bump copyright year.
Fix eng/gpr/gpr#14
2023-01-02 11:51:43 +01:00
Pierre Béguet
52566ad278 Pack and attribute identifier refactoring in libGPR2
Major change into libGPR2 and GPRTools, all APIs previously
using Attribute_Id and/or Package_Id/Attribute_Id are now
using the combined qualified name Q_Attribute_Id in order
to unify APIs usage.
Few exceptions exist when retriving Attributes from a named
Package.
As Q_Attribute_Id is now used all over libGPR2, the list of
Attribute_Id constants was removed and a list of Q_Attribute_Id
constants can now be found at the same place. This was done
to simplify APIs call by providing defined and registered
attributes qualified name.

V720-027 :
When users are adding attributes without adding a package first
this package is not taken into account when launching Validity_Check.
We cannot make the assumption on which kind of project this package
is authorized to be in, so we are adding a precondition.
We now raise an ASSERTION_ERROR when trying to add an attribute
in a unknown package.

TN: V725-008
TN: V720-027
Change-Id: I3807ac993002c308021f082c7ba034cc371563cc
2022-08-29 07:35:59 +00:00
Fabien Chouteau
bb9b6a7bb3 Change license header of GPR2 library to Apache 2.0
no-precommit-check
This patch is rejected by the "Copyright notice must include current
year" check, we actually want to preserve the copyright years here.

TN: V822-021
Change-Id: Iad42ad0863f12d7a3c714855287c5996581910b6
2022-08-24 15:07:24 +00:00
Jérôme Lambourg
3ddedc127b Update year in copyright notice
no-tn-check

Change-Id: I6c02538c84e05dd1668a27f673146cc5793a81c5
2022-01-04 09:26:28 +00:00
Nicolas Roche
2a8a657854 Refactor the way view attributes are computed.
The view's "Attribute" function now fully computes the attributes values
based on the attributes definitions in Project.Registry.Attribute.

The various subprograms that were used to retrieve individually those
values are now simplified and call Attribute.

As a result, retrieval of Package Values and Attributes need to be
performed via the View, so as a result GPR2.Project.Pack is now a private
package, and only contains the raw object definition of a Package.

The parser is also reworked to benefit from the attribute computation when
referencing attributes. As a result it now need to work on the view object
rather than trying to build first the lists of variables and attributes
before building the object.

In order for the parser to see the package definition, it has been also
renamed to GPR2.Project.Parser, and GPR2.Parser hierarchy is now removed.

Finally, the GPR2.Project.Attribute object has been improved to include
missing information to fully handle all situations. In particular the
notion of Aliased attributes is now added to it (attributes that have
different names, such as Spec and Specification).

Part of U813-023

Change-Id: Ife12e67035c45f2915050e6550eb7d83d98fede2
Depends-On: Ie49c13da3ef7dbfc5f9b51f863e46b9f0ff9c4d1
2021-11-25 16:38:32 +01:00
Jerome Lambourg
20071b09cd Add an attribute id and package id
This allows for faster retrieval of attributes with the use of containers
manipulating bounded values, as well as simple integer comparisons.

Depends-On: I325abb397527ac72abff4f3bfe315a3a42aad25b
TN: U722-008

Change-Id: Ic56ecb845fb6768d62b5b6c533850c2f58550469
2021-08-15 21:36:12 +02:00
Dmitriy Anisimkov
9effb6632e Fix filename case sensitivity
TB05-027

Split Name_Type usage between identifiers and filenames.
Use Filename_Type for filenames. It is case sensitive or not depend on OS
filesystem case sensitivity.
Add parameter Force_Spec for artifacts creation to fix naming exception
processing.

Change-Id: Ib2cafee6496e0a4782738d7c466edb98c1b59e9b
2020-11-13 08:40:29 +06:00
Pascal Obry
787388747f Attribute.Name now returns an Identifier.Object.
We were passing the name as an Identifier.Object but storing only
the name as a string hence losing the sloc. Furthermore now Name
does return an Identifier.Object.

Change-Id: I51f8c1e8ee872360bfa40f564d42ddfc5d856933
2019-05-18 18:01:37 +02:00
Pascal Obry
0468c48a5e Attribute's Index is now source referenced.
This continue the implementation for attrbutes's name and value.

Change-Id: I9a9898b19bea7905a3f1c14848150a23f1bc63f8
2019-02-17 19:15:31 +01:00
Robin Morier
fb4488f3cb Change all headers to Adacore (2019).
Change-Id: I42bb106e26be87e226a3d202b80d9edc1446afe5
2019-02-12 11:59:41 +01:00
Pascal Obry
2ce754cc39 Attribute's Name and Value/Values are now source referenced.
The Name is a Source_Reference.Identifier.Object and the Value
is a Source_Reference.Value.Object. This is needed to be able
to record the source references for values. The API is now also
cleaner, we were passing the Name (as Name_Type) and the corresponding
sloc to each routine. Now the slock for the Name is into the
corresponding object.

This change also support Name and Value for variables and types.

Adapt the code to this new API.

Change-Id: Ica2bd2ab0f4666c58378d7b8b7748b7b58613269
2019-02-12 11:22:36 +01:00
Pascal Obry
3a763b2859 A single prefix for a variable may be a project or packages.
The semantic is that we look first for a project and then
for a packages.

Add corresponding regression test.

Part of OB10-014.

Change-Id: I37bc6226627dc23255ff0ff54b8cdebdb5eb956e
2017-11-01 17:35:27 +01:00