21 Commits

Author SHA1 Message Date
Pierre-Marie de Rodat
859f5701dd C/Python/OCaml/Java: bind all GPR loading options
(cherry picked from commit f39ebe979e)
2025-10-23 12:23:52 +00:00
Pierre-Marie de Rodat
433fe6c7b2 Bind target information type and primitives to the Python API 2024-10-15 13:49:57 +00:00
Pierre-Marie de Rodat
210f039cc6 C/Python/OCaml APIs: bind GPR2's autoconf language restriction to Ada 2024-09-06 08:00:19 +00:00
Pierre-Marie de Rodat
639f3a3059 Python API: add missing doc for GPRProject.__init__(config_file) 2024-09-06 08:00:19 +00:00
Hugo Guerrier
6490b69c1e Add support for .cgpr files into GPR project handling 2024-05-29 13:28:57 +00:00
Pierre-Marie de Rodat
1a8a26284b Fix "-gnateP" typos in comments
While the implementation correctly references the `-gnatep` compiler
switch, comments incorrectly mention `-gnateP` (casing typo). Fix these
typos.
2023-11-06 08:42:51 +00:00
Pierre-Marie de Rodat
e7e53514f6 Python API: bind Libadalang.Config_Pragmas.Set_Mappings 2023-08-14 08:35:57 +00:00
Pierre-Marie de Rodat
7019f9e90b Python API: bind Create_Context_From_Project 2023-08-01 15:31:33 +00:00
Pierre-Marie de Rodat
19fc4d96c5 Add default charset detection from project file
This change adds new functions to allow detection of the default charset
to use when decoding source files from a GPR (sub)project:
``Libadalang.Project_Provider.Default_Charset_From_Project`` in Ada,
``libadalang.GPRProject.default_charset`` in Python.
2023-04-24 09:33:22 +00:00
Pierre-Marie de Rodat
935217e1b7 Libadalang.Project_Provider: extend the Source_Files function
Add a new argument (with default value, to avoid breaking the public
API) that controls the set of projects to inspect. This allows to
override the default behavior, which starts from the root project only.

Also extend the C and Python APIs accordingly. Leave the OCaml bindings
for later.
2023-04-05 08:24:06 +00:00
Pierre-Marie de Rodat
a0f2f34ae7 Python API: fix UnitProvider.auto
The recent refactoring for GPR projects handling (#932) broke this
function. Do what is necessary to fix it.

TN: VB02-014
2022-11-04 15:41:02 +00:00
Pierre-Marie de Rodat
3c61ecd198 Python API: expose error messages from GPR project files
TN: VA14-036
2022-10-19 12:02:24 +00:00
Pierre-Marie de Rodat
ce06d52e74 C API: rename "source file array" to "string array"
This data structure has nothing specific to filenames: rename it so that
it feels natural for upcoming work to use it to store other strings.

TN: VA14-036
2022-10-19 11:17:44 +00:00
Pierre-Marie de Rodat
2642253366 C API: add a "line_mode" argument when creating preprocessor from GPR
The "create_preprocessor_from_file" function takes a "line_mode"
argument, making it possible to force the line mode for all source files
that must be preprocessed. Add a similar argument to the
"gpr_project_create_preprocessor" function.

TN: VA12-019
2022-10-19 11:17:23 +00:00
Pierre-Marie de Rodat
b29dc70f2d Preprocessing: make it possible to collect compiler opts. from a subprj.
In particular for aggregate projects, it is sometimes necessary to
restrict the analysis to a sub-project in a GPR project tree. Similarly
to the project-based unit provider, add a Project/Project_Name argument
to the subprograms that collect preprocessor-related compilation options
in project files to restrict their analysis to a sub-project.

TN: V708-022
2022-07-18 13:18:15 +02:00
Pierre-Marie de Rodat
582459c162 Introduce functions to extract preprocessing data from GPR projects
TN: V708-022
2022-07-18 13:18:15 +02:00
Pierre-Marie de Rodat
cc8ea09cd1 C API: minor refactoring
Rename the types to control scenario variables to follow the same
naming conventions as other types in this area.

For #932
2022-07-18 13:14:27 +02:00
Pierre-Marie de Rodat
b8d5e16c38 Python API: rework GPR projects handling
This commit introduces a new class that represents a loaded project
(GPRProject), created from the usual project loading arguments (project
file, scenario variables, target and RTS info). This new class provides
two methods: create_unit_provider(project=None) to create a unit
provider wrapping a project and source_files(mode) to query the list of
source files in a project.

It also removes the now obsolete SourceFiles class (recently added), but
preserves the UnitProvider.for_project method to avoid breaking existing
user code (been there for several years).

Closes #932
2022-07-18 13:14:27 +02:00
Pierre-Marie de Rodat
53e4720b7b C/Python APIs: add a function to list sources from a project file
TN: UB29-005
2021-12-01 11:10:38 +01:00
Pierre-Marie de Rodat
834d28f018 Update after the addition of arguments to the "parents" builtin property
TN: U329-073
2021-04-06 14:52:25 +02:00
Pierre-Marie de Rodat
4382a22f9c Reorganize the source tree
Move most of "ada/*" to the root directory (this makes sense, as this
repository has been dedicated to Libadalang for years), and rename
"ada/language" to "ada".

TN: T914-010
2020-11-02 16:51:46 +01:00