Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdks/csharp/SpacetimeDB.ClientSDK.Godot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<AssemblyVersion>2.3.0</AssemblyVersion>
<Version>2.3.0</Version>
<DefaultItemExcludes>$(DefaultItemExcludes);*~/**</DefaultItemExcludes>
<RestorePackagesPath>packages</RestorePackagesPath>
<RestorePackagesPath>obj~/godot/packages</RestorePackagesPath>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<DefineConstants>$(DefineConstants);GODOT</DefineConstants>
<!-- Godot.NET.Sdk defaults to .godot/mono/temp; build this package like the regular C# SDK. -->
Expand Down
14 changes: 8 additions & 6 deletions tools/regen/src/csharp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::fs;
use std::path::{Path, PathBuf};

const BSATN_PACKAGE_ID: &str = "spacetimedb.bsatn.runtime";
const GODOTSHARP_PACKAGE_ID: &str = "godotsharp";
const RUNTIME_PACKAGE_ID: &str = "spacetimedb.runtime";

fn workspace_dir() -> PathBuf {
Expand Down Expand Up @@ -117,7 +116,7 @@ fn clear_restored_package_dirs(pkg_id: &str) -> Result<()> {
Ok(())
}

fn clear_godot_intermediate_outputs() -> Result<()> {
fn clear_godot_regen_dir() -> Result<()> {
let godot_obj_dir = sdk_dir().join("obj~/godot");
if godot_obj_dir.exists() {
fs::remove_dir_all(&godot_obj_dir)?;
Expand Down Expand Up @@ -219,10 +218,11 @@ pub fn regen_dlls() -> Result<()> {
clear_restored_package_dirs(RUNTIME_PACKAGE_ID)?;

// Some Unity runners have had partially restored GodotSharp package state in the past.
// Clear the package and restore outputs so NuGet cannot reuse assets missing GodotSharp.dll.
// Godot restores packages under obj~/godot/packages, so clearing obj~/godot removes
// both intermediates and Godot-only packages without touching Unity-visible packages.
// This prevents NuGet from reusing assets missing GodotSharp.dll.
// See https://github.com/clockworklabs/SpacetimeDB/pull/5133 for more details.
clear_restored_package_dirs(GODOTSHARP_PACKAGE_ID)?;
clear_godot_intermediate_outputs()?;
clear_godot_regen_dir()?;

cmd!(
"dotnet",
Expand All @@ -244,6 +244,7 @@ pub fn regen_dlls() -> Result<()> {
"-p:BaseOutputPath=bin~/",
"-p:BaseIntermediateOutputPath=obj~/godot/",
"-p:MSBuildProjectExtensionsPath=obj~/godot/",
"-p:RestorePackagesPath=obj~/godot/packages",
)
.dir(&sdk)
.run()?;
Expand Down Expand Up @@ -272,7 +273,8 @@ pub fn regen_dlls() -> Result<()> {
"-p:BaseOutputPath=bin~/",
// TODO: It should be possible to put this in Directory.Build.props, but it caused CI failures when we did.
"-p:BaseIntermediateOutputPath=obj~/godot/",
"-p:MSBuildProjectExtensionsPath=obj~/godot/"
"-p:MSBuildProjectExtensionsPath=obj~/godot/",
"-p:RestorePackagesPath=obj~/godot/packages",
)
.dir(&sdk)
.run()?;
Expand Down
Loading