MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / regen_dlls

Function regen_dlls

tools/regen/src/csharp.rs:186–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184}
185
186pub fn regen_dlls() -> Result<()> {
187 let workspace = workspace_dir();
188 let sdk = sdk_dir();
189
190 cmd!(
191 "dotnet",
192 "pack",
193 workspace.join("crates/bindings-csharp/BSATN.Runtime"),
194 "-c",
195 "Release"
196 )
197 .run()?;
198 cmd!(
199 "dotnet",
200 "pack",
201 workspace.join("crates/bindings-csharp/Runtime"),
202 "-c",
203 "Release"
204 )
205 .run()?;
206
207 let nuget_config_dir = tempfile::tempdir()?;
208 let nuget_config_path = nuget_config_dir.path().join("nuget.config");
209 fs::write(
210 &nuget_config_path,
211 render_nuget_config(
212 &workspace.join("crates/bindings-csharp/BSATN.Runtime/bin/Release"),
213 &workspace.join("crates/bindings-csharp/Runtime/bin/Release"),
214 ),
215 )?;
216
217 clear_restored_package_dirs(BSATN_PACKAGE_ID)?;
218 clear_restored_package_dirs(RUNTIME_PACKAGE_ID)?;
219
220 // Some Unity runners have had partially restored GodotSharp package state in the past.
221 // Godot restores packages under obj~/godot/packages, so clearing obj~/godot removes
222 // both intermediates and Godot-only packages without touching Unity-visible packages.
223 // This prevents NuGet from reusing assets missing GodotSharp.dll.
224 // See https://github.com/clockworklabs/SpacetimeDB/pull/5133 for more details.
225 clear_godot_regen_dir()?;
226
227 cmd!(
228 "dotnet",
229 "restore",
230 "SpacetimeDB.ClientSDK.csproj",
231 "--configfile",
232 path_arg(&nuget_config_path),
233 )
234 .dir(&sdk)
235 .run()?;
236
237 cmd!(
238 "dotnet",
239 "restore",
240 "SpacetimeDB.ClientSDK.Godot.csproj",
241 "--configfile",
242 path_arg(&nuget_config_path),
243 // TODO: It should be possible to put this in Directory.Build.props, but it caused CI failures when we did.

Callers 1

mainFunction · 0.85

Calls 10

workspace_dirFunction · 0.85
sdk_dirFunction · 0.85
render_nuget_configFunction · 0.85
clear_godot_regen_dirFunction · 0.85
joinMethod · 0.80
OkFunction · 0.50
runMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…