@@ -11,6 +11,12 @@ defmodule OuterBrain.Build.WeldContract do
1111
1212 @ repo_root Path . expand ( ".." , __DIR__ )
1313
14+ @ manifest_dependencies [
15+ :ground_plane_contracts ,
16+ :jido_integration_provider_classification ,
17+ :mezzanine_eval_engine
18+ ]
19+
1420 @ artifact_docs [
1521 "README.md" ,
1622 "docs/overview.md" ,
@@ -33,6 +39,7 @@ defmodule OuterBrain.Build.WeldContract do
3339 publication: [
3440 internal_only: [
3541 "." ,
42+ "core/context_abi" ,
3643 "core/memory_contracts" ,
3744 "core/memory_engine" ,
3845 "core/context_budget" ,
@@ -77,22 +84,37 @@ defmodule OuterBrain.Build.WeldContract do
7784 end
7885
7986 defp dependencies do
80- [
81- mezzanine_eval_engine: manifest_dependency ( :mezzanine_eval_engine )
82- ]
87+ Enum . map ( @ manifest_dependencies , fn app ->
88+ { app , manifest_dependency ( app ) }
89+ end )
8390 end
8491
8592 defp manifest_dependency ( app ) do
86- case DependencySources . deps ( @ repo_root , publish?: true ) |> List . keyfind ( app , 0 ) do
87- { ^ app , requirement } when is_binary ( requirement ) ->
88- [ requirement: requirement ]
93+ config = Map . fetch! ( dependency_configs ( ) , app )
94+ github = Map . fetch! ( config , :github )
95+
96+ [ opts: github_opts ( github ) ]
97+ end
98+
99+ defp dependency_configs do
100+ { config , _binding } =
101+ @ repo_root
102+ |> Path . join ( "build_support/dependency_sources.config.exs" )
103+ |> Code . eval_file ( )
104+
105+ Map . new ( config [ :deps ] , fn { app , dep_config } -> { app , Map . new ( dep_config ) } end )
106+ end
107+
108+ defp github_opts ( github ) do
109+ github = Map . new ( github )
110+ repo = Map . fetch! ( github , :repo )
89111
90- { ^ app , requirement , opts } when is_binary ( requirement ) ->
91- [ requirement: requirement , opts: opts ]
112+ opts =
113+ github
114+ |> Map . take ( [ :branch , :ref , :tag , :subdir ] )
115+ |> Enum . sort_by ( fn { key , _value } -> key end )
92116
93- { ^ app , opts } when is_list ( opts ) ->
94- [ opts: opts ]
95- end
117+ Keyword . merge ( [ github: repo ] , opts )
96118 end
97119end
98120
0 commit comments