10
10
from conans .model .ref import ConanFileReference
11
11
12
12
from cpt import __version__ as package_tools_version , get_client_version
13
- from cpt .config import ConfigManager
13
+ from cpt .config import ConfigManager , GlobalConf
14
14
from cpt .printer import Printer
15
15
from cpt .profiles import load_profile , patch_default_base_profile
16
16
from conans .client .conan_api import ProfileData
@@ -23,7 +23,7 @@ def __init__(self, profile_abs_path, reference, conan_api, uploader,
23
23
cwd = None , printer = None , upload = False , upload_only_recipe = None ,
24
24
test_folder = None , config_url = None , config_args = None ,
25
25
upload_dependencies = None , conanfile = None , skip_recipe_export = False ,
26
- update_dependencies = False , lockfile = None , profile_build_abs_path = None ):
26
+ update_dependencies = False , lockfile = None , profile_build_abs_path = None , global_conf = None ):
27
27
28
28
self .printer = printer or Printer ()
29
29
self ._cwd = cwd or os .getcwd ()
@@ -54,6 +54,7 @@ def __init__(self, profile_abs_path, reference, conan_api, uploader,
54
54
self ._update_dependencies = update_dependencies
55
55
self ._results = None
56
56
self ._profile_build_abs_path = profile_build_abs_path
57
+ self ._global_conf = global_conf
57
58
58
59
patch_default_base_profile (conan_api , profile_abs_path )
59
60
client_version = get_client_version ()
@@ -86,6 +87,10 @@ def run(self):
86
87
if self ._config_url :
87
88
ConfigManager (self ._conan_api , self .printer ).install (url = self ._config_url , args = self ._config_args )
88
89
90
+ if self ._global_conf :
91
+ global_conf = GlobalConf (self ._conan_api , self .printer )
92
+ global_conf .populate (self ._global_conf )
93
+
89
94
context = tools .no_op ()
90
95
compiler = self .settings .get ("compiler" , None )
91
96
if not self ._exclude_vcvars_precommand :
@@ -213,7 +218,8 @@ def __init__(self, profile_text, base_profile_text, base_profile_name, reference
213
218
lockfile = None ,
214
219
profile_build_text = None ,
215
220
base_profile_build_text = None ,
216
- cwd = None ):
221
+ cwd = None ,
222
+ global_conf = None ):
217
223
218
224
self .printer = printer or Printer ()
219
225
self ._upload = upload
@@ -253,6 +259,7 @@ def __init__(self, profile_text, base_profile_text, base_profile_name, reference
253
259
self ._profile_build_text = profile_build_text
254
260
self ._base_profile_build_text = base_profile_build_text
255
261
self ._cwd = cwd or os .getcwd ()
262
+ self ._global_conf = global_conf
256
263
257
264
def _pip_update_conan_command (self ):
258
265
commands = []
@@ -375,6 +382,7 @@ def get_env_vars(self):
375
382
ret ["CPT_BASE_PROFILE" ] = escape_env (self ._base_profile_text )
376
383
ret ["CPT_BASE_PROFILE_NAME" ] = escape_env (self ._base_profile_name )
377
384
ret ["CPT_PROFILE_BUILD" ] = escape_env (self ._profile_build_text )
385
+ ret ["CPT_GLOBAL_CONF" ] = escape_env (self ._global_conf )
378
386
379
387
ret ["CONAN_USERNAME" ] = escape_env (self ._reference .user or ret .get ("CONAN_USERNAME" ))
380
388
ret ["CONAN_TEMP_TEST_FOLDER" ] = "1" # test package folder to a temp one
0 commit comments