@@ -81,6 +81,9 @@ def build_extension(self, ext):
8181 if ext .name != "clr" :
8282 return build_ext .build_extension (self , ext )
8383
84+ # install packages using nuget
85+ self ._install_packages ()
86+
8487 dest_file = self .get_ext_fullpath (ext .name )
8588 dest_dir = os .path .dirname (dest_file )
8689 if not os .path .exists (dest_dir ):
@@ -164,6 +167,29 @@ def _build_monoclr(self, ext):
164167 debug = self .debug )
165168
166169
170+ def _install_packages (self ):
171+ """install packages using nuget"""
172+ nuget = os .path .join ("tools" , "nuget" , "nuget.exe" )
173+ use_shell = False
174+ if DEVTOOLS == "Mono" :
175+ nuget = "mono %s" % nuget
176+ use_shell = True
177+
178+ for dir in os .listdir ("src" ):
179+ if DEVTOOLS == "Mono" and dir == "clrmodule" :
180+ continue
181+ if DEVTOOLS != "Mono" and dir == "monoclr" :
182+ continue
183+
184+ packages_cfg = os .path .join ("src" , dir , "packages.config" )
185+ if not os .path .exists (packages_cfg ):
186+ continue
187+
188+ cmd = "%s install %s -o packages" % (nuget , packages_cfg )
189+ self .announce ("Installng packages for %s: %s" % (dir , cmd ))
190+ check_call (cmd , shell = use_shell )
191+
192+
167193class PythonNET_InstallLib (install_lib ):
168194
169195 def install (self ):
0 commit comments