@@ -207,12 +207,13 @@ def getPlugins(self):
207207class LocalConf (object ):
208208
209209 def __init__ (self , localrc , localconf , base_services , services , plugins ,
210- base_dir , projects ):
210+ base_dir , projects , project ):
211211 self .localrc = []
212212 self .meta_sections = {}
213213 self .plugin_deps = {}
214214 self .base_dir = base_dir
215215 self .projects = projects
216+ self .project = project
216217 if plugins :
217218 self .handle_plugins (plugins )
218219 if services or base_services :
@@ -249,11 +250,15 @@ def handle_localrc(self, localrc):
249250 if k == 'LIBS_FROM_GIT' :
250251 lfg = True
251252
252- if not lfg and self .projects :
253+ if not lfg and ( self .projects or self . project ) :
253254 required_projects = []
254- for project_name , project_info in self .projects .items ():
255- if project_info .get ('required' ):
256- required_projects .append (project_info ['short_name' ])
255+ if self .projects :
256+ for project_name , project_info in self .projects .items ():
257+ if project_info .get ('required' ):
258+ required_projects .append (project_info ['short_name' ])
259+ if self .project :
260+ if self .project ['short_name' ] not in required_projects :
261+ required_projects .append (self .project ['short_name' ])
257262 if required_projects :
258263 self .localrc .append ('LIBS_FROM_GIT={}' .format (
259264 ',' .join (required_projects )))
@@ -291,6 +296,7 @@ def main():
291296 base_dir = dict (type = 'path' ),
292297 path = dict (type = 'str' ),
293298 projects = dict (type = 'dict' ),
299+ project = dict (type = 'dict' ),
294300 )
295301 )
296302
@@ -301,7 +307,8 @@ def main():
301307 p .get ('services' ),
302308 p .get ('plugins' ),
303309 p .get ('base_dir' ),
304- p .get ('projects' ))
310+ p .get ('projects' ),
311+ p .get ('project' ))
305312 lc .write (p ['path' ])
306313
307314 module .exit_json ()
0 commit comments