com.elestrago.unity.generated-code-dump 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/CHANGELOG.md.meta +7 -0
  3. package/Documentation~/api.md +583 -0
  4. package/Documentation~/examples/dump-in-batch-mode.md +43 -0
  5. package/Documentation~/examples/dump-now.md +29 -0
  6. package/Documentation~/examples/read-the-dump.md +63 -0
  7. package/Documentation~/examples/turn-on-the-dump.md +33 -0
  8. package/Documentation~/examples.md +24 -0
  9. package/Documentation~/manual.md +618 -0
  10. package/Editor/AssemblyInfo.cs +3 -0
  11. package/Editor/AssemblyInfo.cs.meta +2 -0
  12. package/Editor/GeneratedCodeDump.Editor.asmdef +16 -0
  13. package/Editor/GeneratedCodeDump.Editor.asmdef.meta +7 -0
  14. package/Editor/GeneratedCodeDumpArgs.cs +113 -0
  15. package/Editor/GeneratedCodeDumpArgs.cs.meta +2 -0
  16. package/Editor/GeneratedCodeDumpFiles.cs +120 -0
  17. package/Editor/GeneratedCodeDumpFiles.cs.meta +2 -0
  18. package/Editor/GeneratedCodeDumpFinisher.cs +103 -0
  19. package/Editor/GeneratedCodeDumpFinisher.cs.meta +2 -0
  20. package/Editor/GeneratedCodeDumpIdentity.cs +40 -0
  21. package/Editor/GeneratedCodeDumpIdentity.cs.meta +2 -0
  22. package/Editor/GeneratedCodeDumpJobs.cs +242 -0
  23. package/Editor/GeneratedCodeDumpJobs.cs.meta +2 -0
  24. package/Editor/GeneratedCodeDumpMigration.cs +112 -0
  25. package/Editor/GeneratedCodeDumpMigration.cs.meta +2 -0
  26. package/Editor/GeneratedCodeDumpNames.cs +104 -0
  27. package/Editor/GeneratedCodeDumpNames.cs.meta +2 -0
  28. package/Editor/GeneratedCodeDumpOutput.cs +449 -0
  29. package/Editor/GeneratedCodeDumpOutput.cs.meta +2 -0
  30. package/Editor/GeneratedCodeDumpPathBudget.cs +67 -0
  31. package/Editor/GeneratedCodeDumpPathBudget.cs.meta +2 -0
  32. package/Editor/GeneratedCodeDumpPaths.cs +145 -0
  33. package/Editor/GeneratedCodeDumpPaths.cs.meta +2 -0
  34. package/Editor/GeneratedCodeDumpProcess.cs +119 -0
  35. package/Editor/GeneratedCodeDumpProcess.cs.meta +2 -0
  36. package/Editor/GeneratedCodeDumpRsp.cs +107 -0
  37. package/Editor/GeneratedCodeDumpRsp.cs.meta +2 -0
  38. package/Editor/GeneratedCodeDumpSession.cs +65 -0
  39. package/Editor/GeneratedCodeDumpSession.cs.meta +2 -0
  40. package/Editor/GeneratedCodeDumpSettings.cs +111 -0
  41. package/Editor/GeneratedCodeDumpSettings.cs.meta +2 -0
  42. package/Editor/GeneratedCodeDumpSettingsFile.cs +231 -0
  43. package/Editor/GeneratedCodeDumpSettingsFile.cs.meta +2 -0
  44. package/Editor/GeneratedCodeDumpSettingsProvider.cs +93 -0
  45. package/Editor/GeneratedCodeDumpSettingsProvider.cs.meta +2 -0
  46. package/Editor/GeneratedCodeDumpSettingsWatcher.cs +199 -0
  47. package/Editor/GeneratedCodeDumpSettingsWatcher.cs.meta +2 -0
  48. package/Editor/GeneratedCodeDumper.cs +689 -0
  49. package/Editor/GeneratedCodeDumper.cs.meta +2 -0
  50. package/Editor/GeneratedCodeMenuItems.cs +46 -0
  51. package/Editor/GeneratedCodeMenuItems.cs.meta +2 -0
  52. package/Editor.meta +8 -0
  53. package/LICENSE.md +21 -0
  54. package/LICENSE.md.meta +7 -0
  55. package/README.md +164 -0
  56. package/README.md.meta +7 -0
  57. package/package.json +31 -0
  58. package/package.json.meta +7 -0
@@ -0,0 +1,43 @@
1
+ # Generated Code Dump — Example: Dump in batch mode
2
+
3
+ ## When to use it
4
+
5
+ Use it in CI, or as an agent without the Editor window, when you need the whole dump on disk. Turn the per-user setting on, then start Unity in batch mode: with `-quit`, Unity exits only after the dump is complete.
6
+
7
+ ## Snippet
8
+
9
+ ```bash
10
+ PROJECT=/path/to/project
11
+ UNITY=~/Unity/Hub/Editor/6000.0.65f1/Editor/Unity # your Unity Editor binary
12
+ SETTINGS="$PROJECT/UserSettings/GeneratedCodeDumpSettings.json"
13
+ DUMP="$PROJECT/Library/GeneratedCodeDump"
14
+
15
+ # Turn the dump on for this checkout, then start Unity; it quits once the dump is done.
16
+ mkdir -p "$PROJECT/UserSettings"
17
+ printf '{"enabled": true}\n' > "$SETTINGS"
18
+ "$UNITY" -batchmode -nographics -projectPath "$PROJECT" -quit -logFile "$PROJECT/dump.log" \
19
+ || echo "Unity exited with an error: see dump.log"
20
+
21
+ # Read the dump's log lines, check that it ran and no job is left, and list the result.
22
+ grep '\[Generated Code Dump\]' "$PROJECT/dump.log"
23
+ if ! grep -q '\[Generated Code Dump\] queued' "$PROJECT/dump.log"; then echo "no dump ran: see dump.log"
24
+ elif grep -q '^job' "$DUMP/.work/jobs.txt"; then echo "dump incomplete"
25
+ else echo "dump complete"; fi
26
+ ls "$DUMP"
27
+
28
+ # Optional: turn it off again, so later batch runs on this machine skip the dump.
29
+ rm "$SETTINGS"
30
+ ```
31
+
32
+ ## What you'll see
33
+
34
+ - The log shows `[Generated Code Dump] queued <N> assemblies, at most <M> compiling at once; output in Library/GeneratedCodeDump/`, where `<N>` counts the queued assemblies and `<M>` is how many compile at once. Unity quits once the dump is done, and `Library/GeneratedCodeDump/` holds one folder per assembly that has generated files, next to `.work/`, the dump's own bookkeeping folder.
35
+ - A batch-mode start with the dump on always runs a *full dump*: a *replay* of every assembly that loads an *analyzer*. A replay runs Unity's compiler once more for one assembly to collect its generated files; an analyzer is a compiler plug-in DLL, which is how source generators ship. See [When a dump runs](../manual.md#when-a-dump-runs).
36
+ - Batch mode has no background thread. The Editor's own thread starts the compiler processes and waits for them, so the dump is complete before `-quit` takes effect. See [Batch mode and CI](../manual.md#batch-mode-and-ci).
37
+ - The wait has a cap: 300 seconds per round of compiles, where a round is as many assemblies as compile at once. For 11 assemblies at 6 at once that is 2 rounds, so at most 600 seconds. Past the cap the log says `[Generated Code Dump] stopped waiting after <seconds> s; the rest of the dump finishes in the next Editor session.` The unfinished *jobs* (one line per requested replay) stay in `.work/jobs.txt`, and the snippet prints `dump incomplete`. The next Editor start with the dump on, batch mode included, picks them up. See [Batch mode and CI](../manual.md#batch-mode-and-ci).
38
+ - A single compiler that runs for more than 300 seconds is stopped and its output ignored, with the warning `[Generated Code Dump] <Assembly>: the compiler ran for over 300 s, so it was stopped and its output is ignored.` See [Warnings and failures](../manual.md#warnings-and-failures).
39
+ - A file whose path is over the OS limit even with every name cut short is skipped, with the warning `[Generated Code Dump] <Assembly>: <N> files skipped: their path is over the <limit>-character limit of this OS; move the project to a shorter path.` and then the skipped paths. `<limit>` is 259 on Windows and 1023 on macOS and Linux. See [Long paths](../manual.md#long-paths).
40
+ - On this repository's example project, on a machine with 12 logical CPUs, a full dump queued 11 assemblies and compiled 6 at once. Compiling took about 1.7 seconds of a 7.5-second batch run (start, import, dump, quit). See [Performance](../manual.md#performance).
41
+ - The settings file is the only switch; there is no command-line flag. While it is on, every batch run of the project, `-runTests` and builds included, runs the same full dump at start and waits for it. See [Batch mode and CI](../manual.md#batch-mode-and-ci).
42
+
43
+ For contributors: [GeneratedCodeDumper](../api.md#generatedcodedumper), [GeneratedCodeDumpJobs](../api.md#generatedcodedumpjobs)
@@ -0,0 +1,29 @@
1
+ # Generated Code Dump — Example: Dump Now and Open Folder
2
+
3
+ ## When to use it
4
+
5
+ Use `Tools/Generated Code Dump/Dump Now` for a one-off refresh of the whole dump; it works even while the dump is off. `Tools/Generated Code Dump/Open Folder` opens `Library/GeneratedCodeDump/` in your file browser, and both are also buttons on the `Preferences/Generated Code Dump` page.
6
+
7
+ ## Snippet
8
+
9
+ ```bash
10
+ # First click Tools/Generated Code Dump/Dump Now in the Editor.
11
+ # Then, from the project root, wait until no job is left and list the result.
12
+ DUMP=Library/GeneratedCodeDump
13
+ while grep -q '^job' "$DUMP/.work/jobs.txt" 2>/dev/null; do sleep 1; done
14
+ ls "$DUMP"
15
+ # The Editor log on Linux; on macOS it is ~/Library/Logs/Unity/Editor.log,
16
+ # on Windows %LOCALAPPDATA%\Unity\Editor\Editor.log
17
+ grep '\[Generated Code Dump\]' ~/.config/unity3d/Editor.log | tail -n 5
18
+ ```
19
+
20
+ ## What you'll see
21
+
22
+ - The Console logs `[Generated Code Dump] queued <N> assemblies, at most <M> compiling at once; output in Library/GeneratedCodeDump/`, where `<N>` counts the queued assemblies and `<M>` is how many compile at once. Dump Now runs a *full dump*: a *replay* of every assembly of Unity's latest compile that loads an *analyzer*. A replay runs Unity's compiler once more for one assembly to collect its generated files; an analyzer is a compiler plug-in DLL, which is how source generators ship. See [When a dump runs](../manual.md#when-a-dump-runs).
23
+ - The Editor does not wait. Each replay is a separate compiler process; a background thread starts them and collects their output every 250 ms (four times a second), so the dump keeps going while the Editor is in the background. At most one compiler runs per two logical CPUs, never fewer than 1 or more than 8: 6 on a machine with 12 logical CPUs. See [Performance](../manual.md#performance).
24
+ - Each queued replay is a *job*, one line starting with `job` in `.work/jobs.txt` (`.work/` is the dump's own bookkeeping folder). When all are done, the file holds only its `next <id>` line (the id the next job will get), which is what the snippet's loop waits for. See [When a dump runs](../manual.md#when-a-dump-runs).
25
+ - Each finished assembly's folder is updated to match the new output, and `.work/<Assembly>/` keeps only that replay's compiler arguments (`replay.rsp`) and error log (`errors.sarif`). On Windows `.work/` is hidden, so Open Folder shows only the assembly folders. See [How it works](../manual.md#how-it-works).
26
+ - Neither Dump Now nor Open Folder turns the dump on, so while it is off, later compiles do not refresh the output. They are the only two actions that create anything under `Library/GeneratedCodeDump/` while it is off; Open Folder creates the folder if it is missing. See [Turning it on and off](../manual.md#turning-it-on-and-off).
27
+ - If Unity's compiler or its build folder `Library/Bee/artifacts` is missing, Dump Now logs one warning, such as `[Generated Code Dump] Unity's C# compiler was not found at <path>.`, and queues nothing. The compiler is `DotNetSdkRoslyn/csc.dll`, run with `NetCoreRuntime/dotnet`, both inside the Unity Editor install: under `Editor/Data/` on Windows and Linux, and `Unity.app/Contents/` on macOS. See [Warnings and failures](../manual.md#warnings-and-failures).
28
+
29
+ For contributors: [GeneratedCodeMenuItems](../api.md#generatedcodemenuitems), [GeneratedCodeDumper](../api.md#generatedcodedumper), [GeneratedCodeDumpFinisher](../api.md#generatedcodedumpfinisher), [GeneratedCodeDumpJobs](../api.md#generatedcodedumpjobs)
@@ -0,0 +1,63 @@
1
+ # Generated Code Dump — Example: Read the dump
2
+
3
+ ## When to use it
4
+
5
+ Use it when you or an AI agent want to see what a source generator really wrote, instead of guessing from the attributes and `partial` declarations. The dump is in `Library/GeneratedCodeDump/`, and grepping the header lines of its files finds a file even when its name was cut short to fit the OS path limit.
6
+
7
+ ## Snippet
8
+
9
+ ```bash
10
+ DUMP=Library/GeneratedCodeDump
11
+ ls "$DUMP" # one folder per assembly that has generated files
12
+ find "$DUMP/Assembly-CSharp" -type f | sort # one assembly's files, one folder per generator assembly
13
+ grep -rl --exclude-dir=.work "Hint: .*ExampleBehaviour" "$DUMP" # every file whose hint name mentions the type, cut or not
14
+ grep -rl --exclude-dir=.work "partial class ExampleBehaviour" "$DUMP" # the generated parts of one type
15
+ grep -rh --exclude-dir=.work "Dumped: " "$DUMP" | sort | uniq -c # when the files were dumped
16
+ ```
17
+
18
+ Part of the real dump of this repository's example project, for `Assembly-CSharp` and one asmdef assembly, made by its test generators (`Assets/Example/Generators/`, built from `External/`, not shipped). It is an excerpt: the project's other assemblies are left out. Paths are inside `Library/GeneratedCodeDump/`:
19
+
20
+ ```text
21
+ Assembly-CSharp/GeneratedCodeDump.TestGenerators.Classic/Aux_.g.cs
22
+ Assembly-CSharp/GeneratedCodeDump.TestGenerators.Classic/ExampleBehaviour.generated.cs
23
+ Assembly-CSharp/GeneratedCodeDump.TestGenerators.Classic/ExampleBehaviour~31a944ea.generated.cs
24
+ Assembly-CSharp/GeneratedCodeDump.TestGenerators.Incremental/Example.ExampleBehaviour.Dumpable.g.cs
25
+ Assembly-CSharp/GeneratedCodeDump.TestGenerators.Incremental/Summary.Info.g.cs
26
+ Assembly-CSharp/Unity.SourceGenerators/AssemblyMonoScriptTypes.generated.cs
27
+ GeneratedCodeDump.Example.Module/GeneratedCodeDump.TestGenerators.Classic/Aux_.g.cs
28
+ GeneratedCodeDump.Example.Module/GeneratedCodeDump.TestGenerators.Classic/DeepRecord.generated.cs
29
+ GeneratedCodeDump.Example.Module/GeneratedCodeDump.TestGenerators.Classic/DeepRecord~5fee0560.generated.cs
30
+ GeneratedCodeDump.Example.Module/GeneratedCodeDump.TestGenerators.Classic/ModuleService.generated.cs
31
+ GeneratedCodeDump.Example.Module/GeneratedCodeDump.TestGenerators.Incremental/GeneratedCodeDump.Example.Module.Deep.DeepRecord.Dumpable.g.cs
32
+ GeneratedCodeDump.Example.Module/GeneratedCodeDump.TestGenerators.Incremental/GeneratedCodeDump.Example.Module.ModuleService.Dumpable.g.cs
33
+ GeneratedCodeDump.Example.Module/GeneratedCodeDump.TestGenerators.Incremental/Summary.Info.g.cs
34
+ GeneratedCodeDump.Example.Module/Unity.SourceGenerators/AssemblyMonoScriptTypes.generated.cs
35
+ ```
36
+
37
+ The head of `Assembly-CSharp/GeneratedCodeDump.TestGenerators.Incremental/Example.ExampleBehaviour.Dumpable.g.cs` (the `Dumped:` time changes with every dump):
38
+
39
+ ```csharp
40
+ // <auto-generated/>
41
+ // Dumped: 2026-09-12 10:15:03 UTC
42
+ // Assembly: Assembly-CSharp
43
+ // Generator: GeneratedCodeDump.TestGenerators.Incremental / GeneratedCodeDump.TestGenerators.Incremental.DumpableGenerator
44
+ // Hint: Example.ExampleBehaviour.Dumpable.g.cs
45
+ namespace Example
46
+ {
47
+ partial class ExampleBehaviour
48
+ ```
49
+
50
+ ## What you'll see
51
+
52
+ - The first folder is the compiled assembly: `Assembly-CSharp`, or an asmdef name such as `GeneratedCodeDump.Example.Module`. The second is the *generator assembly*, the DLL the source generator ships in, such as `Unity.SourceGenerators` for Unity's own. See [Reading the output](../manual.md#reading-the-output).
53
+ - The file name is the *hint name*: the name the generator gave the file, kept exactly as one flat name, with no namespace folders. `Example.ExampleBehaviour.Dumpable.g.cs` is one. See [Reading the output](../manual.md#reading-the-output).
54
+ - `ExampleBehaviour~31a944ea.generated.cs` sits next to `ExampleBehaviour.generated.cs` because two generators in one generator assembly gave the same hint name. One of them gets a *short hash*: a `~` and 8 hex digits computed from that generator's full type name and the hint name, the same on every machine. `DeepRecord~5fee0560.generated.cs` is the same case in the other assembly; which of the two gets the hash is in [Reading the output](../manual.md#reading-the-output).
55
+ - `Aux_.g.cs` was `Aux.g.cs`. `AUX` is a reserved device name on Windows, so the dump adds an `_`. See [Reading the output](../manual.md#reading-the-output).
56
+ - Every file gets four header lines with full names: `Dumped:` (when the compiler that produced it started, in UTC), `Assembly:`, `Generator:` (generator assembly, then the generator's full type name) and `Hint:`. They follow a `// <auto-generated/>` line as above, close a `// <auto-generated>` comment block, or else come first. The file's BOM and line endings are kept. See [Reading the output](../manual.md#reading-the-output).
57
+ - The greps pass `--exclude-dir=.work` to skip `.work/`, the dump's own bookkeeping folder next to the assembly folders. It holds no generated code.
58
+ - A path too long for the OS is cut in this order, stopping as soon as it fits: the assembly folder, then the generator folder, then the file name. Each cut keeps the start of the name and adds a short hash (a *cut name*). The header lines keep the full names, so the `Hint:` grep above still finds a cut file. A file that still does not fit is skipped with the warning `[Generated Code Dump] <Assembly>: <N> files skipped: their path is over the <limit>-character limit of this OS; move the project to a shorter path.`, where `<limit>` is 259 on Windows and 1023 on macOS and Linux. See [Long paths](../manual.md#long-paths).
59
+ - Only assemblies that load an *analyzer*, a compiler plug-in DLL such as a source generator, are *replayed*: compiled once more to collect the generated files. Unity's own `Unity.SourceGenerators` runs on most assemblies, so most of them get an `AssemblyMonoScriptTypes.generated.cs`.
60
+ - Each replay syncs its assembly's whole folder: a file the generators no longer produce is deleted, and an assembly with no generated files has no folder. See [Reading the output](../manual.md#reading-the-output).
61
+ - A file open in another program during a dump is not replaced, so it keeps its older `Dumped:` line; the Console warns and the next dump tries again. See [Warnings and failures](../manual.md#warnings-and-failures).
62
+
63
+ For contributors: [GeneratedCodeDumpOutput](../api.md#generatedcodedumpoutput), [GeneratedCodeDumpNames](../api.md#generatedcodedumpnames), [GeneratedCodeDumpPathBudget](../api.md#generatedcodedumppathbudget), [GeneratedCodeDumpPaths](../api.md#generatedcodedumppaths)
@@ -0,0 +1,33 @@
1
+ # Generated Code Dump — Example: Turn on the dump
2
+
3
+ ## When to use it
4
+
5
+ Use it when you want the dump for yourself in this project: it is off until you turn it on. In the Editor, click `Tools/Generated Code Dump/Enabled` (checked while on) or tick `Dump generated code` on the `Preferences/Generated Code Dump` page; without the Editor window, for example as an AI agent, write the settings file from a shell as below.
6
+
7
+ ## Snippet
8
+
9
+ ```bash
10
+ # From the project root. The menu, the Preferences toggle and this command all write the same file,
11
+ # and both an open Editor and later batch-mode runs read it.
12
+ mkdir -p UserSettings
13
+ printf '{"enabled": true}\n' > UserSettings/GeneratedCodeDumpSettings.json
14
+
15
+ # To turn it off again, write false, or delete the file (no file means off).
16
+ # printf '{"enabled": false}\n' > UserSettings/GeneratedCodeDumpSettings.json
17
+
18
+ # The switch is yours alone, so check that git leaves UserSettings/ out.
19
+ git check-ignore -q UserSettings/GeneratedCodeDumpSettings.json && echo "ignored" || echo "add /[Uu]ser[Ss]ettings/ to .gitignore"
20
+ ```
21
+
22
+ ## What you'll see
23
+
24
+ - An open Editor picks up the change within about a second, even while it is in the background. If `UserSettings/` did not exist yet, it notices the new folder too. A closed Editor reads the file when it next starts, and so does a batch-mode run. See [Turning it on and off](../manual.md#turning-it-on-and-off).
25
+ - The switch is the file `UserSettings/GeneratedCodeDumpSettings.json`, in Unity's per-user folder. It survives deleting `Library/`, and each developer turns the dump on for themselves. If the last line of the snippet does not print `ignored`, add `/[Uu]ser[Ss]ettings/` to `.gitignore`, or the switch gets committed.
26
+ - Turning it on starts a *full dump*. The Console logs `[Generated Code Dump] queued <N> assemblies, at most <M> compiling at once; output in Library/GeneratedCodeDump/`, where `<N>` is the number of assemblies to compile again and `<M>` how many compile at the same time. The file `Library/GeneratedCodeDump/.work/enabled-session` appears.
27
+ - A full dump is a *replay* of every assembly that loads an *analyzer*. A replay runs Unity's own compiler again for one assembly and keeps the files its source generators write. An analyzer is a plug-in DLL for the compiler; source generators ship as analyzers, so an assembly without one has nothing to dump.
28
+ - Every later Editor start with the dump on runs a full dump too. The `enabled-session` file is how the dump tells a new Editor start from a domain reload. See [When a dump runs](../manual.md#when-a-dump-runs).
29
+ - After each compile, only the assemblies it rebuilt, and of those only the ones that load an analyzer, are replayed. An assembly that failed to compile is skipped until it compiles again. If you delete `Library/GeneratedCodeDump/` while the dump is on, the next domain reload runs a full dump. See [When a dump runs](../manual.md#when-a-dump-runs).
30
+ - A file that is not a JSON object with `enabled` set to `true` or `false` counts as off, and the Console warns `[Generated Code Dump] <full path> is not valid: expected {"enabled": true} or false. The dump is off.` It warns again only when the file changes and is still invalid. The exact file format is in [Turning it on and off](../manual.md#turning-it-on-and-off).
31
+ - Turning the dump off drops the replays that have not started yet. `Library/GeneratedCodeDump/` stays as it is, but later compiles no longer refresh it. See [Turning it on and off](../manual.md#turning-it-on-and-off).
32
+
33
+ For contributors: [GeneratedCodeMenuItems](../api.md#generatedcodemenuitems), [GeneratedCodeDumpSettingsProvider](../api.md#generatedcodedumpsettingsprovider), [GeneratedCodeDumpSettings](../api.md#generatedcodedumpsettings), [GeneratedCodeDumpSettingsFile](../api.md#generatedcodedumpsettingsfile), [GeneratedCodeDumpSettingsWatcher](../api.md#generatedcodedumpsettingswatcher), [GeneratedCodeDumpSession](../api.md#generatedcodedumpsession)
@@ -0,0 +1,24 @@
1
+ <!-- examples:curated -->
2
+
3
+ # Generated Code Dump — Examples
4
+
5
+ Four short tasks. Each one stands on its own, gives a shell snippet (run from the Unity project root unless it sets `$PROJECT`), and says what you'll see afterwards.
6
+
7
+ There is no C# API to call. You drive the package with the `Tools/Generated Code Dump/` menu, the `Preferences/Generated Code Dump` page, or the per-user settings file `UserSettings/GeneratedCodeDumpSettings.json`. All three change the same switch.
8
+
9
+ ## Contents
10
+
11
+ | Example | You want to… |
12
+ |---------|--------------|
13
+ | [Turn on the dump](examples/turn-on-the-dump.md) | switch the dump on or off for yourself in this project, from the Editor or from a shell |
14
+ | [Read the dump](examples/read-the-dump.md) | find and read the code a source generator wrote for a type, even when its file name was cut short |
15
+ | [Dump Now and Open Folder](examples/dump-now.md) | refresh the whole dump once, even while it is off, and open its folder |
16
+ | [Dump in batch mode](examples/dump-in-batch-mode.md) | get a complete dump from CI or an agent, with no Editor window |
17
+
18
+ ## Notes
19
+
20
+ - Paths are relative to the Unity project root, unless a snippet sets `$PROJECT`.
21
+ - The switch is yours alone. It lives in `UserSettings/`, Unity's per-user folder, which Unity's standard `.gitignore` keeps out of version control. A missing or invalid file means off. See [Turning it on and off](manual.md#turning-it-on-and-off).
22
+ - The dump is in `Library/GeneratedCodeDump/`: one folder per assembly that has generated files, then one per generator assembly (the DLL a source generator ships in), then the files. Next to them sits `.work/`, the dump's own bookkeeping folder, so pass `--exclude-dir=.work` when you grep. See [Reading the output](manual.md#reading-the-output).
23
+ - The dump never changes Unity's own compile output under `Library/Bee/` and never breaks the project's compile. Every problem shows up as a Console warning that starts with `[Generated Code Dump]`. See [Warnings and failures](manual.md#warnings-and-failures).
24
+ - These pages are written by hand. The `<!-- examples:curated -->` marker on the first line tells the `unity-package-docs` skill to leave this index and every example page as they are.