@@ -244,12 +244,12 @@ def cppython(self):
244
244
"""
245
245
return self ._modified_cppython_data
246
246
247
- def download (self ) -> None :
247
+ def download_generator_tools (self ) -> None :
248
248
"""
249
249
Download the generator tooling if required
250
250
"""
251
251
if not self ._enabled :
252
- cppython_logger .info ("Skipping download because the project is not enabled" )
252
+ cppython_logger .info ("Skipping 'download_generator_tools' because the project is not enabled" )
253
253
return
254
254
255
255
base_path = self .cppython .install_path
@@ -269,6 +269,24 @@ def download(self) -> None:
269
269
else :
270
270
cppython_logger .info (f"The { generator .name ()} generator is already downloaded" )
271
271
272
+ def update_generator_tools (self ) -> None :
273
+ """
274
+ Update the generator tooling if available
275
+ """
276
+ if not self ._enabled :
277
+ cppython_logger .info ("Skipping 'update_generator_tools' because the project is not enabled" )
278
+ return
279
+
280
+ self .download_generator_tools ()
281
+
282
+ base_path = self .cppython .install_path
283
+
284
+ for generator in self ._generators :
285
+
286
+ path = base_path / generator .name ()
287
+
288
+ generator .update_generator (path )
289
+
272
290
# API Contract
273
291
def install (self ) -> None :
274
292
"""
@@ -278,9 +296,10 @@ def install(self) -> None:
278
296
cppython_logger .info ("Skipping install because the project is not enabled" )
279
297
return
280
298
281
- cppython_logger .info ("Installing project " )
282
- self .download ()
299
+ cppython_logger .info ("Installing tools " )
300
+ self .download_generator_tools ()
283
301
302
+ cppython_logger .info ("Installing project" )
284
303
tool_path = self .cppython .tool_path
285
304
tool_path .mkdir (parents = True , exist_ok = True )
286
305
@@ -307,6 +326,9 @@ def update(self) -> None:
307
326
cppython_logger .info ("Skipping update because the project is not enabled" )
308
327
return
309
328
329
+ cppython_logger .info ("Updating tools" )
330
+ self .update_generator_tools ()
331
+
310
332
cppython_logger .info ("Updating project" )
311
333
312
334
tool_path = self .cppython .tool_path
0 commit comments