Skip to content

Commit

Permalink
Better encapsulation
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Nov 13, 2023
1 parent 06496c6 commit 3bb4ff0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/alire/alire-config-edit-early_load.adb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package body Alire.Config.Edit.Early_Load is

-----------------
-- Load_Config --
-----------------

procedure Load_Config is
begin
Alire.Config.Edit.Load_Config;
end Load_Config;

end Alire.Config.Edit.Early_Load;
7 changes: 7 additions & 0 deletions src/alire/alire-config-edit-early_load.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package Alire.Config.Edit.Early_Load is

procedure Load_Config;
-- For internal use of Alire_Early_Elaboration, DO NOT CALL otherwise.
-- This should be hidden but that would require a non-trivial refactoring.

end Alire.Config.Edit.Early_Load;
5 changes: 3 additions & 2 deletions src/alire/alire-config-edit.ads
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ package Alire.Config.Edit is
return Boolean;
-- Check that the combination satisfies builtin rules

private

procedure Load_Config;
-- Clear and reload all configuration. Also set some values elsewhere
-- used to break circularities. Bottom line, this procedure must leave
-- the program-wide configuration ready. This is done during startup from
-- Alire_Early_Elaboration so config is available ASAP; regular clients of
-- libalire shouldn't need to call this explicitly.
-- Alire_Early_Elaboration so config is available ASAP.

end Alire.Config.Edit;
4 changes: 2 additions & 2 deletions src/alire/alire_early_elaboration.adb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ with AAA.Strings;

with Ada.Directories;

with Alire.Config.Edit;
with Alire.Config.Edit.Early_Load;

with GNAT.Command_Line;
with GNAT.OS_Lib;
Expand Down Expand Up @@ -180,7 +180,7 @@ package body Alire_Early_Elaboration is
end if;

-- Load config ASAP
Alire.Config.Edit.Load_Config;
Alire.Config.Edit.Early_Load.Load_Config;
end Early_Switch_Detection;

-------------------
Expand Down

0 comments on commit 3bb4ff0

Please sign in to comment.