Skip to content

Commit a95d754

Browse files
authored
Moved C# SDK's packages ignore from SDK's .gitignore to project root (#4211)
# Description of Changes Moves the `root/sdks/csharp/packages/` directory from the `root/sdks/csharp/.gitignore` to `root/.gitignore`. This is to resolve Issue #4207 , which was introduced during the DLLs generation rework. `/sdks/csharp/packages/` should be ignored by git, to prevent locally generated DLLs from accidentally getting added to the repo. **Root cause:** When Unity imports a package by URL, it looks at the `.gitignore` list and filters by it, causing the entire `packages` directory to not be imported. In earlier versions of Unity (like `2022.3` where this was initially tested), this was not a problem because Unity would allow us to do a `dotnet restore`. In modern version of Unity, this is no longer allowed as all imported packages are considered immutable. Because the `/sdks/csharp/` is cloned into `com.clockworklabs.spacetimedbsdk`, if we move at what level the `root/sdks/csharp/packages/` is ignored at, we can prevent the accidental inclusion of the DLLs from developers in the SpacetimeDB repo, while ensuring `com.clockworklabs.spacetimedbsdk` does not contain a reference to ignore the `packages` directory. # API and ABI breaking changes No API or ABI changes # Expected complexity level and risk 1 If you answered more than a 2, explain what is complex about the PR, and what other components it interacts with in potentially concerning ways. --> # Testing - [X] Tested removing the `packages` directory from the `.gitignore` list on a custom branch of `com.clockworklabs.spacetimedbsdk` to observe the behavior in both Unity `6000.3.2f1` and `2002.3.62f2`.
1 parent eb2997e commit a95d754

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,7 @@ nul
245245

246246
[Nn][Uu][Gg][Ee][Tt].[Cc][Oo][Nn][Ff][Ii][Gg]
247247
[Nn][Uu][Gg][Ee][Tt].[Cc][Oo][Nn][Ff][Ii][Gg].meta
248+
249+
# csharp SDK packages
250+
/sdks/csharp/packages/
251+
/sdks/csharp/packages.meta

sdks/csharp/.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,4 @@ obj~
7575
# This is used for local paths to SpacetimeDB packages.
7676
[Nn][Uu][Gg][Ee][Tt].config
7777
[Nn][Uu][Gg][Ee][Tt].config.meta
78-
.idea/
79-
80-
# Hydrated SDK DLLs (produced by `cargo ci dlls`)
81-
/packages/
82-
/packages.meta
83-
!/packages/.gitignore
78+
.idea/

0 commit comments

Comments
 (0)