@@ -81,6 +81,9 @@ def build_extension(self, ext):
81
81
if ext .name != "clr" :
82
82
return build_ext .build_extension (self , ext )
83
83
84
+ # install packages using nuget
85
+ self ._install_packages ()
86
+
84
87
dest_file = self .get_ext_fullpath (ext .name )
85
88
dest_dir = os .path .dirname (dest_file )
86
89
if not os .path .exists (dest_dir ):
@@ -164,6 +167,29 @@ def _build_monoclr(self, ext):
164
167
debug = self .debug )
165
168
166
169
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
+
167
193
class PythonNET_InstallLib (install_lib ):
168
194
169
195
def install (self ):
0 commit comments