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.
- package/CHANGELOG.md +16 -0
- package/CHANGELOG.md.meta +7 -0
- package/Documentation~/api.md +583 -0
- package/Documentation~/examples/dump-in-batch-mode.md +43 -0
- package/Documentation~/examples/dump-now.md +29 -0
- package/Documentation~/examples/read-the-dump.md +63 -0
- package/Documentation~/examples/turn-on-the-dump.md +33 -0
- package/Documentation~/examples.md +24 -0
- package/Documentation~/manual.md +618 -0
- package/Editor/AssemblyInfo.cs +3 -0
- package/Editor/AssemblyInfo.cs.meta +2 -0
- package/Editor/GeneratedCodeDump.Editor.asmdef +16 -0
- package/Editor/GeneratedCodeDump.Editor.asmdef.meta +7 -0
- package/Editor/GeneratedCodeDumpArgs.cs +113 -0
- package/Editor/GeneratedCodeDumpArgs.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpFiles.cs +120 -0
- package/Editor/GeneratedCodeDumpFiles.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpFinisher.cs +103 -0
- package/Editor/GeneratedCodeDumpFinisher.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpIdentity.cs +40 -0
- package/Editor/GeneratedCodeDumpIdentity.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpJobs.cs +242 -0
- package/Editor/GeneratedCodeDumpJobs.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpMigration.cs +112 -0
- package/Editor/GeneratedCodeDumpMigration.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpNames.cs +104 -0
- package/Editor/GeneratedCodeDumpNames.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpOutput.cs +449 -0
- package/Editor/GeneratedCodeDumpOutput.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpPathBudget.cs +67 -0
- package/Editor/GeneratedCodeDumpPathBudget.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpPaths.cs +145 -0
- package/Editor/GeneratedCodeDumpPaths.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpProcess.cs +119 -0
- package/Editor/GeneratedCodeDumpProcess.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpRsp.cs +107 -0
- package/Editor/GeneratedCodeDumpRsp.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpSession.cs +65 -0
- package/Editor/GeneratedCodeDumpSession.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpSettings.cs +111 -0
- package/Editor/GeneratedCodeDumpSettings.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpSettingsFile.cs +231 -0
- package/Editor/GeneratedCodeDumpSettingsFile.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpSettingsProvider.cs +93 -0
- package/Editor/GeneratedCodeDumpSettingsProvider.cs.meta +2 -0
- package/Editor/GeneratedCodeDumpSettingsWatcher.cs +199 -0
- package/Editor/GeneratedCodeDumpSettingsWatcher.cs.meta +2 -0
- package/Editor/GeneratedCodeDumper.cs +689 -0
- package/Editor/GeneratedCodeDumper.cs.meta +2 -0
- package/Editor/GeneratedCodeMenuItems.cs +46 -0
- package/Editor/GeneratedCodeMenuItems.cs.meta +2 -0
- package/Editor.meta +8 -0
- package/LICENSE.md +21 -0
- package/LICENSE.md.meta +7 -0
- package/README.md +164 -0
- package/README.md.meta +7 -0
- package/package.json +31 -0
- package/package.json.meta +7 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## [1.0.0](https://gitlab.com/elestrago-pkg/generated-code-dump/-/tags/1.0.0)
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added a dump of every Roslyn source generator's output to `Library/GeneratedCodeDump/` after each compile. See `README.md`.
|
|
10
|
+
- Added `Dumped:`, `Assembly:`, `Generator:` and `Hint:` header lines to every dumped file. See `Documentation~/manual.md`.
|
|
11
|
+
- Added short-hash name cutting so every dump path fits the OS path limit. See `Documentation~/manual.md`.
|
|
12
|
+
- Added the per-user switch in `Preferences/Generated Code Dump`, `Tools/Generated Code Dump/Enabled` and `UserSettings/GeneratedCodeDumpSettings.json`. See `Documentation~/examples/turn-on-the-dump.md`.
|
|
13
|
+
- Added `Tools/Generated Code Dump/Dump Now` and `Open Folder` menu items. See `Documentation~/examples/dump-now.md`.
|
|
14
|
+
- Added a blocking full dump when a batch-mode Editor starts with the dump on. See `Documentation~/examples/dump-in-batch-mode.md`.
|
|
15
|
+
|
|
16
|
+
---
|
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
<!-- generated by unity-package-docs; safe to regenerate -->
|
|
2
|
+
<!-- unity-package-docs: scanner=2.0.2; api-render=2 -->
|
|
3
|
+
|
|
4
|
+
# Generated Code Dump — API Reference
|
|
5
|
+
|
|
6
|
+
Comprehensive reference for every public/internal type and member. Generated from source; do not edit by hand.
|
|
7
|
+
|
|
8
|
+
## Contents
|
|
9
|
+
|
|
10
|
+
- [`GeneratedCodeDump.Editor`](#generatedcodedumpeditor)
|
|
11
|
+
|
|
12
|
+
## `GeneratedCodeDump.Editor`
|
|
13
|
+
|
|
14
|
+
### GeneratedCodeDumpArgs
|
|
15
|
+
|
|
16
|
+
```csharp
|
|
17
|
+
internal static class GeneratedCodeDumpArgs
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpArgs.cs:10` (md5: `e75a0a6ba274cff0c5f8d1240dadc7f0`, lines: 113)
|
|
21
|
+
|
|
22
|
+
Reads and rewrites a Unity compiler response file (one argument per line) so it can be replayed with generated-files output, without overwriting any of Unity's own outputs. No UnityEditor use.
|
|
23
|
+
|
|
24
|
+
**Members:**
|
|
25
|
+
|
|
26
|
+
| Kind | Name | Signature | Line | Summary |
|
|
27
|
+
|------|------|-----------|------|---------|
|
|
28
|
+
| method | HasAnalyzer | `internal static bool HasAnalyzer(IEnumerable<string> lines)` | 29 | True when the compilation loads at least one analyzer (`-analyzer:` or `/analyzer:`, any case). Without one no source generator runs, so a replay could produce nothing. |
|
|
29
|
+
| method | Rewrite | `internal static List<string> Rewrite(IEnumerable<string> lines, string outDll, string refDll, string generatedDir, string errorLog)` | 45 | Drops every output-writing argument (both '-' and '/' prefixes, any case) and appends `-out`, `-refout`, `-generatedfilesout` and `-errorlog` with quoted paths. Every other line is kept unchanged and in order. |
|
|
30
|
+
|
|
31
|
+
### GeneratedCodeDumpEntry
|
|
32
|
+
|
|
33
|
+
```csharp
|
|
34
|
+
internal sealed class GeneratedCodeDumpEntry
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpOutput.cs:12` (md5: `0acc716509ba2c9af0a56aa2cd27cd8c`, lines: 449)
|
|
38
|
+
|
|
39
|
+
One file of the compiler's generated-files output and its dump name before any cut.
|
|
40
|
+
|
|
41
|
+
**Members:**
|
|
42
|
+
|
|
43
|
+
| Kind | Name | Signature | Line | Summary |
|
|
44
|
+
|------|------|-----------|------|---------|
|
|
45
|
+
| field | Source | `internal string Source` | 18 | Path under the generated-files output, '/'-separated: `<GeneratorAssembly>/<GeneratorType>/<hint name>`. |
|
|
46
|
+
| field | GeneratorAssembly | `internal string GeneratorAssembly` | 23 | The generator's assembly name; null for a file fewer than two folders deep. |
|
|
47
|
+
| field | GeneratorType | `internal string GeneratorType` | 28 | The generator's full type name; null for a file fewer than two folders deep. |
|
|
48
|
+
| field | Hint | `internal string Hint` | 33 | The hint name as the generator gave it; `Source` when no generator is known. |
|
|
49
|
+
| field | GeneratorFolder | `internal string GeneratorFolder` | 38 | The generator's folder with its full, safe name; null when no generator is known. |
|
|
50
|
+
| field | Name | `internal string Name` | 44 | Path under `GeneratorFolder` (else under the assembly folder), '/'-separated and safe. Its last part is the file name. |
|
|
51
|
+
| property | FullPath | `internal string FullPath { get; }` | 49 | Path under the assembly folder with full names. |
|
|
52
|
+
|
|
53
|
+
### GeneratedCodeDumper
|
|
54
|
+
|
|
55
|
+
```csharp
|
|
56
|
+
internal static class GeneratedCodeDumper
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumper.cs:47` (md5: `a25cc70f77709d7c8c36041c75f505ed`, lines: 689)
|
|
60
|
+
**Attributes:** `[InitializeOnLoad]`
|
|
61
|
+
|
|
62
|
+
After each compile, replays Unity's compiler response file of every rebuilt assembly that loads an analyzer, with `-generatedfilesout`, so the files every source generator produced land in `Library/GeneratedCodeDump/<Assembly>/<GeneratorAssembly>/`. The replay writes its assemblies to the job's temp folder and never touches Unity's own Library/Bee outputs.
|
|
63
|
+
|
|
64
|
+
**Members:**
|
|
65
|
+
|
|
66
|
+
| Kind | Name | Signature | Line | Summary |
|
|
67
|
+
|------|------|-----------|------|---------|
|
|
68
|
+
| field | MaxConcurrent | `internal static readonly int MaxConcurrent` | 56 | Compilers that may run at once: half the logical processors, between 1 and 8. |
|
|
69
|
+
| method | DumpIfJustEnabled | `internal static void DumpIfJustEnabled()` | 112 | Dumps everything when the dump has just turned on — Editor start, or the setting switched on in Preferences, the menu or its file — or when its output folder is missing, so the folder is never stale or absent while the dump is on. Turning it off drops the jobs that have not started. Safe on any thread. |
|
|
70
|
+
| method | DumpAll | `internal static int DumpAll()` | 160 | Queues every assembly of the newest build graph that loads an analyzer, whatever the setting. Returns how many were queued. Safe on any thread. |
|
|
71
|
+
| method | SetEnabled | `internal static void SetEnabled(bool enabled)` | 194 | Saves the setting and acts on it at once. Main thread (Preferences page and menu). |
|
|
72
|
+
| method | Tick | `internal static void Tick()` | 213 | One round of the finisher: moves the output of every exited replay into the dump, then starts queued jobs while fewer than `MaxConcurrent` compilers run. |
|
|
73
|
+
| method | HasJobs | `internal static bool HasJobs()` | 219 | |
|
|
74
|
+
| method | BatchWaitSeconds | `internal static double BatchWaitSeconds(int jobs, int maxConcurrent, double jobTimeoutSeconds)` | 228 | How long batch mode waits for `jobs` jobs: every job may take the full timeout, and `maxConcurrent` of them run at once. |
|
|
75
|
+
|
|
76
|
+
### GeneratedCodeDumpFiles
|
|
77
|
+
|
|
78
|
+
```csharp
|
|
79
|
+
internal static class GeneratedCodeDumpFiles
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpFiles.cs:12` (md5: `9bb31041be2e5656ca9fe700a7873518`, lines: 120)
|
|
83
|
+
|
|
84
|
+
File helpers shared by the dump's state files (settings, jobs, session marker) and its work folders. No UnityEditor use, so every thread can call them.
|
|
85
|
+
|
|
86
|
+
**Members:**
|
|
87
|
+
|
|
88
|
+
| Kind | Name | Signature | Line | Summary |
|
|
89
|
+
|------|------|-----------|------|---------|
|
|
90
|
+
| field | Utf8NoBom | `internal static readonly Encoding Utf8NoBom` | 14 | |
|
|
91
|
+
| method | WriteAtomic | `internal static void WriteAtomic(string path, string text)` | 20 | Writes `text` to `<path>.tmp`, then moves it over `path`, so a reader, or an Editor that stops mid-write, never sees half a file. Creates the folder. |
|
|
92
|
+
| method | ReadTextOrNull | `internal static string ReadTextOrNull(string path)` | 42 | The file's text, or null when it does not exist. Any other failure throws, so a caller never takes a file it could not read for an empty one. |
|
|
93
|
+
| method | CreateHiddenDirectory | `internal static void CreateHiddenDirectory(string path)` | 58 | Creates the folder and, on Windows, marks it Hidden, so Explorer lists only what sits next to it. Failing to mark it is ignored. |
|
|
94
|
+
| method | DeleteDirectory | `internal static void DeleteDirectory(string path)` | 76 | |
|
|
95
|
+
| method | TryDeleteDirectory | `internal static void TryDeleteDirectory(string path)` | 82 | |
|
|
96
|
+
| method | TryDeleteEmptyDirectory | `internal static void TryDeleteEmptyDirectory(string path)` | 94 | |
|
|
97
|
+
| method | TryDeleteFile | `internal static void TryDeleteFile(string path)` | 107 | |
|
|
98
|
+
|
|
99
|
+
### GeneratedCodeDumpFinisher
|
|
100
|
+
|
|
101
|
+
```csharp
|
|
102
|
+
internal static class GeneratedCodeDumpFinisher
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpFinisher.cs:17` (md5: `c2eb8995bcc71df12da76d650c3e9850`, lines: 103)
|
|
106
|
+
|
|
107
|
+
Background thread that runs `GeneratedCodeDumper.Tick` every 250 ms while there are jobs: it starts queued replays and moves the output of finished ones into the dump. Unlike `EditorApplication.update`, it keeps going while the Editor sits in the background. Not used in batch mode, which finishes the jobs on the calling thread.
|
|
108
|
+
|
|
109
|
+
**Members:**
|
|
110
|
+
|
|
111
|
+
| Kind | Name | Signature | Line | Summary |
|
|
112
|
+
|------|------|-----------|------|---------|
|
|
113
|
+
| property | IsStopping | `internal static bool IsStopping { get; }` | 29 | |
|
|
114
|
+
| method | Start | `internal static void Start()` | 34 | Starts the thread unless it runs already. Call it after adding jobs. |
|
|
115
|
+
| method | Stop | `internal static void Stop()` | 46 | |
|
|
116
|
+
|
|
117
|
+
### GeneratedCodeDumpIdentity
|
|
118
|
+
|
|
119
|
+
```csharp
|
|
120
|
+
internal static class GeneratedCodeDumpIdentity
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpIdentity.cs:7` (md5: `9b603ed77d27e1f4b3998df4eef50ea8`, lines: 40)
|
|
124
|
+
|
|
125
|
+
Every name by which the generated-code dump shows itself: its Library/ folder, log prefix, thread, temp folder, menu and Preferences page.
|
|
126
|
+
|
|
127
|
+
**Members:**
|
|
128
|
+
|
|
129
|
+
| Kind | Name | Signature | Line | Summary |
|
|
130
|
+
|------|------|-----------|------|---------|
|
|
131
|
+
| field | PackageName | `internal const string PackageName` | 14 | The package name. A constant because `PackageInfo.FindForAssembly` returns null when the package sits under Assets/. Up to 1.0.0 it was also the folder name under Library/ (`GeneratedCodeDumpPaths.LegacyRoot`). |
|
|
132
|
+
| field | LibraryFolderName | `internal const string LibraryFolderName` | 20 | The folder under Library/ that holds the dump and its `.work/` folder, kept short for Windows' 260-character path limit. |
|
|
133
|
+
| field | DisplayName | `internal const string DisplayName` | 22 | |
|
|
134
|
+
| field | LogPrefix | `internal const string LogPrefix` | 23 | |
|
|
135
|
+
| field | ThreadName | `internal const string ThreadName` | 24 | |
|
|
136
|
+
| field | ScratchFolderName | `internal const string ScratchFolderName` | 30 | Folder under the system temp folder that holds the compiler outputs, kept short for Windows' 260-character path limit. |
|
|
137
|
+
| field | LegacyScratchFolderName | `internal const string LegacyScratchFolderName` | 35 | The temp folder's name up to 1.0.0. The migration deletes this project's folder in it. |
|
|
138
|
+
| field | MenuRoot | `internal const string MenuRoot` | 37 | |
|
|
139
|
+
| field | SettingsPath | `internal const string SettingsPath` | 38 | |
|
|
140
|
+
|
|
141
|
+
### GeneratedCodeDumpJob
|
|
142
|
+
|
|
143
|
+
```csharp
|
|
144
|
+
internal sealed class GeneratedCodeDumpJob
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpJobs.cs:21` (md5: `05f06b1260978b7f2cf27e99751f9e2c`, lines: 242)
|
|
148
|
+
|
|
149
|
+
One requested replay of an assembly whose output is not in the dump folder yet.
|
|
150
|
+
|
|
151
|
+
**Members:**
|
|
152
|
+
|
|
153
|
+
| Kind | Name | Signature | Line | Summary |
|
|
154
|
+
|------|------|-----------|------|---------|
|
|
155
|
+
| field | Id | `internal long Id` | 23 | |
|
|
156
|
+
| field | Assembly | `internal string Assembly` | 24 | |
|
|
157
|
+
| field | State | `internal GeneratedCodeDumpJobState State` | 25 | |
|
|
158
|
+
| field | ProcessId | `internal int ProcessId` | 26 | |
|
|
159
|
+
| field | ProcessStartUtcTicks | `internal long ProcessStartUtcTicks` | 27 | |
|
|
160
|
+
| field | StartedUtcTicks | `internal long StartedUtcTicks` | 33 | UTC wall time when the compiler was started: the job's timeout counts from it, and it is the `Dumped:` time of the files. |
|
|
161
|
+
| field | Rerun | `internal bool Rerun` | 38 | A dump of the assembly was asked while its compiler ran: replay again once it is done. |
|
|
162
|
+
|
|
163
|
+
### GeneratedCodeDumpJobList
|
|
164
|
+
|
|
165
|
+
```csharp
|
|
166
|
+
internal sealed class GeneratedCodeDumpJobList
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpJobs.cs:44` (md5: `05f06b1260978b7f2cf27e99751f9e2c`, lines: 242)
|
|
170
|
+
|
|
171
|
+
The content of the job store: the jobs, at most one per assembly, and the next id to hand out.
|
|
172
|
+
|
|
173
|
+
**Members:**
|
|
174
|
+
|
|
175
|
+
| Kind | Name | Signature | Line | Summary |
|
|
176
|
+
|------|------|-----------|------|---------|
|
|
177
|
+
| field | Jobs | `internal readonly List<GeneratedCodeDumpJob> Jobs` | 46 | |
|
|
178
|
+
| field | NextId | `internal long NextId` | 47 | |
|
|
179
|
+
| method | Find | `internal GeneratedCodeDumpJob Find(string assembly)` | 49 | |
|
|
180
|
+
| method | FindById | `internal GeneratedCodeDumpJob FindById(long id)` | 54 | |
|
|
181
|
+
| method | Add | `internal GeneratedCodeDumpJob Add(string assembly)` | 62 | Adds a queued job for `assembly` with a fresh id. |
|
|
182
|
+
| method | DropNotStarted | `internal bool DropNotStarted()` | 73 | Drops every replay that has not started: the queued jobs, and the reruns asked of running ones. Returns whether anything changed. |
|
|
183
|
+
|
|
184
|
+
### GeneratedCodeDumpJobs
|
|
185
|
+
|
|
186
|
+
```csharp
|
|
187
|
+
internal static class GeneratedCodeDumpJobs
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpJobs.cs:97` (md5: `05f06b1260978b7f2cf27e99751f9e2c`, lines: 242)
|
|
191
|
+
|
|
192
|
+
The dump jobs, stored in `GeneratedCodeDumpPaths.JobsFile` so they outlive the domain reload that follows every compile, and an Editor restart. Ids only ever go up, so a new job never reuses the scratch folder of an old one.
|
|
193
|
+
|
|
194
|
+
**Members:**
|
|
195
|
+
|
|
196
|
+
| Kind | Name | Signature | Line | Summary |
|
|
197
|
+
|------|------|-----------|------|---------|
|
|
198
|
+
| method | Read | `internal static GeneratedCodeDumpJobList Read(string path)` | 111 | The jobs in `path`; none when the file does not exist. Throws when it exists but cannot be read, so a caller never overwrites jobs it did not see. |
|
|
199
|
+
| method | Write | `internal static void Write(string path, GeneratedCodeDumpJobList list)` | 120 | |
|
|
200
|
+
| method | Any | `internal static bool Any(string path)` | 126 | |
|
|
201
|
+
| method | Format | `internal static string Format(GeneratedCodeDumpJobList list)` | 131 | |
|
|
202
|
+
| method | Parse | `internal static GeneratedCodeDumpJobList Parse(string text)` | 157 | Parses `Format`'s output. A malformed line, or a second job with an id or assembly already seen, is skipped; `GeneratedCodeDumpJobList.NextId` always ends above the highest job id. |
|
|
203
|
+
|
|
204
|
+
### GeneratedCodeDumpJobState
|
|
205
|
+
|
|
206
|
+
```csharp
|
|
207
|
+
internal enum GeneratedCodeDumpJobState
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpJobs.cs:12` (md5: `05f06b1260978b7f2cf27e99751f9e2c`, lines: 242)
|
|
211
|
+
|
|
212
|
+
Where a dump job stands: waiting for a free compiler slot, or its compiler started.
|
|
213
|
+
|
|
214
|
+
**Values:**
|
|
215
|
+
|
|
216
|
+
| Name | Value | Line | Summary |
|
|
217
|
+
|------|-------|------|---------|
|
|
218
|
+
| Queued | — | 14 | |
|
|
219
|
+
| Running | — | 15 | |
|
|
220
|
+
|
|
221
|
+
### GeneratedCodeDumpLayout
|
|
222
|
+
|
|
223
|
+
```csharp
|
|
224
|
+
internal sealed class GeneratedCodeDumpLayout
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpOutput.cs:56` (md5: `0acc716509ba2c9af0a56aa2cd27cd8c`, lines: 449)
|
|
228
|
+
|
|
229
|
+
Where one assembly's files go: its folder (full or cut), each file's path in it, and the files that get no path.
|
|
230
|
+
|
|
231
|
+
**Members:**
|
|
232
|
+
|
|
233
|
+
| Kind | Name | Signature | Line | Summary |
|
|
234
|
+
|------|------|-----------|------|---------|
|
|
235
|
+
| field | AssemblyFolder | `internal string AssemblyFolder` | 58 | |
|
|
236
|
+
| field | OtherAssemblyFolder | `internal string OtherAssemblyFolder` | 63 | The assembly folder's other form (full or cut), which a sync removes; null when both are the same. |
|
|
237
|
+
| field | Files | `internal readonly List<(GeneratedCodeDumpEntry Entry, string Path)> Files` | 68 | Every placed file with its '/'-separated path under `AssemblyFolder`, in entry order. |
|
|
238
|
+
| field | TooLong | `internal readonly List<GeneratedCodeDumpEntry> TooLong` | 73 | Files whose path is over the budget even with every cut. |
|
|
239
|
+
| field | Taken | `internal readonly List<GeneratedCodeDumpEntry> Taken` | 78 | Files whose path an earlier file took. |
|
|
240
|
+
|
|
241
|
+
### GeneratedCodeDumpMigration
|
|
242
|
+
|
|
243
|
+
```csharp
|
|
244
|
+
internal static class GeneratedCodeDumpMigration
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpMigration.cs:18` (md5: `64ce798ead37103b51984d3cd99fb31d`, lines: 112)
|
|
248
|
+
|
|
249
|
+
Moves a project off the 1.0.0 folders: `GeneratedCodeDumpPaths.LegacySettingsFile` becomes `GeneratedCodeDumpPaths.SettingsFile` as it is, unless that file already exists; then the rest of `GeneratedCodeDumpPaths.LegacyRoot` and this project's old temp folder are deleted.
|
|
250
|
+
|
|
251
|
+
**Members:**
|
|
252
|
+
|
|
253
|
+
| Kind | Name | Signature | Line | Summary |
|
|
254
|
+
|------|------|-----------|------|---------|
|
|
255
|
+
| method | ShouldMoveSettings | `internal static bool ShouldMoveSettings(bool legacySettingsExists, bool settingsExists)` | 23 | Whether the legacy setting moves: only when it exists and the new file does not. |
|
|
256
|
+
| method | Run | `internal static void Run()` | 31 | Migrates this project. Never throws. |
|
|
257
|
+
| method | Migrate | `internal static List<string> Migrate(string legacyRoot, string legacySettingsFile, string settingsFile, string legacyScratchRoot, string legacyScratchBase)` | 68 | Moves `legacySettingsFile` to `settingsFile` when `ShouldMoveSettings` says so, then deletes `legacyRoot` and `legacyScratchRoot`, and `legacyScratchBase` when it is empty. Full paths. Returns what failed. |
|
|
258
|
+
|
|
259
|
+
### GeneratedCodeDumpNames
|
|
260
|
+
|
|
261
|
+
```csharp
|
|
262
|
+
internal static class GeneratedCodeDumpNames
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpNames.cs:12` (md5: `668afc44c36e89fb05181aa2dff59e92`, lines: 104)
|
|
266
|
+
|
|
267
|
+
Names in the dump: reserved Windows names made safe, and too-long names cut to `<start>~<fnv8 of the full name>`, so a cut name stays unique and readable.
|
|
268
|
+
|
|
269
|
+
**Members:**
|
|
270
|
+
|
|
271
|
+
| Kind | Name | Signature | Line | Summary |
|
|
272
|
+
|------|------|-----------|------|---------|
|
|
273
|
+
| field | MaxUncutLength | `internal const int MaxUncutLength` | 17 | Names of this many characters or fewer are never cut. |
|
|
274
|
+
| field | CutFolderStart | `internal const int CutFolderStart` | 22 | Characters a cut folder name keeps from the start of the full name. |
|
|
275
|
+
| field | MinCutFileStart | `internal const int MinCutFileStart` | 27 | Fewest characters a cut file name keeps from the start of the full name. |
|
|
276
|
+
| method | Tag | `internal static string Tag(string fullName)` | 45 | `~<fnv8>`: FNV-1a 32 of `fullName` as 8 lowercase hex digits. |
|
|
277
|
+
| method | CutFolder | `internal static string CutFolder(string name)` | 54 | The folder name itself when it has at most `MaxUncutLength` characters, else its first `CutFolderStart` characters and `Tag`. |
|
|
278
|
+
| method | CutFile | `internal static string CutFile(string fileName, int room)` | 67 | The file name itself when it fits in `room` characters, else `<start>~<fnv8><suffix>` exactly `room` long, keeping the `Suffix` whole. Null when fewer than `MinCutFileStart` characters of the start would remain. |
|
|
279
|
+
| method | Suffix | `internal static string Suffix(string fileName)` | 84 | The part of a file name a cut keeps: `.generated.cs`, `.g.cs`, else the extension. |
|
|
280
|
+
| method | SafeSegment | `internal static string SafeSegment(string segment)` | 97 | |
|
|
281
|
+
|
|
282
|
+
### GeneratedCodeDumpOutput
|
|
283
|
+
|
|
284
|
+
```csharp
|
|
285
|
+
internal static class GeneratedCodeDumpOutput
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpOutput.cs:107` (md5: `0acc716509ba2c9af0a56aa2cd27cd8c`, lines: 449)
|
|
289
|
+
|
|
290
|
+
Turns the compiler's generated-files output (`<GeneratorAssembly>/<GeneratorType>/<hint name>`) into the dump layout `<Assembly>/<GeneratorAssembly>/<hint name>`, adds the header lines to every file and syncs it into the dump folder. No UnityEditor use.
|
|
291
|
+
|
|
292
|
+
**Members:**
|
|
293
|
+
|
|
294
|
+
| Kind | Name | Signature | Line | Summary |
|
|
295
|
+
|------|------|-----------|------|---------|
|
|
296
|
+
| method | Entries | `internal static List<GeneratedCodeDumpEntry> Entries(IEnumerable<string> sources)` | 119 | One entry per generated file, from its paths relative to the generated-files output, in ordinal order. The hint becomes one file name in its generator assembly's folder. When an earlier file took that name there, the later one becomes `<stem>~<fnv8 of "<GeneratorType>/<hint>"><suffix>`. A file fewer than two folders deep keeps its path, every part made safe. |
|
|
297
|
+
| method | Plan | `internal static GeneratedCodeDumpLayout Plan(IReadOnlyList<GeneratedCodeDumpEntry> entries, string dumpRoot, string assembly, GeneratedCodeDumpPathBudget budget)` | 160 | Places every entry under `<dumpRoot>/<assembly folder>/` within `budget`. If any file doesn't fit with full names, the assembly folder is cut for every file; then a generator folder is cut for all its files if any of them still doesn't fit; then each file that still doesn't fit gets its name cut to the room left, or is skipped as too long. Only counts lengths. |
|
|
298
|
+
| method | Header | `internal static List<string> Header(string stamp, string assembly, string generatorAssembly, string generatorType, string hint)` | 209 | The header lines of a dumped file, with full names: `Dumped`, `Assembly`, `Generator: <assembly> / <type>` (left out when `generatorAssembly` is null) and `Hint`. |
|
|
299
|
+
| method | Stamp | `internal static string Stamp(string text, IReadOnlyList<string> header)` | 224 | Adds `header` to the file's header: inside a `// <auto-generated>` block, after a `// <auto-generated/>` line, or else as new first lines. Keeps the file's line endings. |
|
|
300
|
+
| method | Sync | `internal static GeneratedCodeDumpSyncResult Sync(string generatedFilesOut, string dumpRoot, string assembly, string stamp, GeneratedCodeDumpPathBudget budget)` | 257 | Writes every file under `generatedFilesOut` into `<dumpRoot>/<assembly folder>/` as `Plan` places it, with the header lines, then deletes every other file there and the assembly folder's other form. Files are replaced in place, so a file another process holds open keeps its older header. The assembly folder is created by the first write and removed when it ends up empty, so an assembly without generated files has no folder. Every listing, write and delete is tried on its own; never throws for a single file. |
|
|
301
|
+
|
|
302
|
+
### GeneratedCodeDumpPathBudget
|
|
303
|
+
|
|
304
|
+
```csharp
|
|
305
|
+
internal readonly struct GeneratedCodeDumpPathBudget
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpPathBudget.cs:15` (md5: `65bce2e8265c8de09e69f527a4d1ff37`, lines: 67)
|
|
309
|
+
|
|
310
|
+
How long a dump path may get on one OS: the whole file path, a folder path and one name. Windows counts UTF-16 characters (MAX_PATH 260 with the NUL, and 12 fewer for a folder); macOS and Linux count UTF-8 bytes (PATH_MAX 1024 on macOS, used for Linux too).
|
|
311
|
+
|
|
312
|
+
**Members:**
|
|
313
|
+
|
|
314
|
+
| Kind | Name | Signature | Line | Summary |
|
|
315
|
+
|------|------|-----------|------|---------|
|
|
316
|
+
| field | Windows | `internal static readonly GeneratedCodeDumpPathBudget Windows` | 17 | |
|
|
317
|
+
| field | Unix | `internal static readonly GeneratedCodeDumpPathBudget Unix` | 18 | |
|
|
318
|
+
| property | Current | `internal static GeneratedCodeDumpPathBudget Current { get; }` | 20 | |
|
|
319
|
+
| property | File | `internal int File { get; }` | 26 | Longest full path of a file. |
|
|
320
|
+
| property | Folder | `internal int Folder { get; }` | 31 | Longest full path of a folder. |
|
|
321
|
+
| property | Name | `internal int Name { get; }` | 36 | Longest single file or folder name. |
|
|
322
|
+
| property | Utf8Bytes | `internal bool Utf8Bytes { get; }` | 41 | True when lengths are counted in UTF-8 bytes, false for UTF-16 characters. |
|
|
323
|
+
| constructor | GeneratedCodeDumpPathBudget | `internal GeneratedCodeDumpPathBudget(int file, int folder, int name, bool utf8Bytes)` | 43 | |
|
|
324
|
+
| method | Length | `internal int Length(string text)` | 51 | |
|
|
325
|
+
| method | Fits | `internal bool Fits(string folder, string fileName)` | 60 | True when `folder` (a full folder path) and `fileName` in it are both within the budget: the folder, the whole path with one separator, and the file name. |
|
|
326
|
+
|
|
327
|
+
### GeneratedCodeDumpPaths
|
|
328
|
+
|
|
329
|
+
```csharp
|
|
330
|
+
internal static class GeneratedCodeDumpPaths
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpPaths.cs:15` (md5: `1127da1a4222128a164db4e3cf43ddad`, lines: 145)
|
|
334
|
+
|
|
335
|
+
Every path used by the generated-code dump. Constants are relative to the project root.
|
|
336
|
+
|
|
337
|
+
**Members:**
|
|
338
|
+
|
|
339
|
+
| Kind | Name | Signature | Line | Summary |
|
|
340
|
+
|------|------|-----------|------|---------|
|
|
341
|
+
| field | Root | `internal const string Root` | 21 | The dump: `<Root>/<Assembly>/<GeneratorAssembly>/<hint>`, next to `WorkFolder`. |
|
|
342
|
+
| field | WorkFolder | `internal const string WorkFolder` | 23 | |
|
|
343
|
+
| field | JobsFile | `internal const string JobsFile` | 24 | |
|
|
344
|
+
| field | SessionMarkerFile | `internal const string SessionMarkerFile` | 25 | |
|
|
345
|
+
| field | SettingsFile | `internal const string SettingsFile` | 31 | The per-user switch. UserSettings/ is Unity's per-user folder: it survives deleting Library/, and Unity's standard .gitignore ignores it. |
|
|
346
|
+
| field | LegacyRoot | `internal const string LegacyRoot` | 36 | The package's Library/ folder up to 1.0.0; `GeneratedCodeDumpMigration` removes it. |
|
|
347
|
+
| field | LegacySettingsFile | `internal const string LegacySettingsFile` | 38 | |
|
|
348
|
+
| field | BeeArtifactsFolder | `internal const string BeeArtifactsFolder` | 39 | |
|
|
349
|
+
| field | ReplayFileName | `internal const string ReplayFileName` | 41 | |
|
|
350
|
+
| field | ErrorLogFileName | `internal const string ErrorLogFileName` | 42 | |
|
|
351
|
+
| property | ProjectRoot | `internal static string ProjectRoot { get; }` | 47 | |
|
|
352
|
+
| method | ToFullPath | `internal static string ToFullPath(string projectRelativePath)` | 50 | |
|
|
353
|
+
| method | WorkDirectory | `internal static string WorkDirectory(string assembly)` | 59 | Work folder of `assembly`, holding `ReplayFileName` and `ErrorLogFileName`. |
|
|
354
|
+
| method | WorkDirectory | `internal static string WorkDirectory(string workFolder, string assembly, GeneratedCodeDumpPathBudget budget)` | 69 | `<workFolder>/<assembly>` (made safe) when both its files fit `budget`, else `<workFolder>/` and the assembly name cut like a dump folder. Only counts lengths. |
|
|
355
|
+
| property | ScratchBase | `internal static string ScratchBase { get; }` | 81 | `<temp>/GenDump/`, shared by every project on this machine. |
|
|
356
|
+
| property | LegacyScratchBase | `internal static string LegacyScratchBase { get; }` | 86 | `<temp>/GCDump/`, the temp folder up to 1.0.0. |
|
|
357
|
+
| property | ScratchRoot | `internal static string ScratchRoot { get; }` | 94 | Root of every dump job's compiler output of this project, in the system temp folder: `<temp>/GenDump/<project hash>/`. The compiler nests each generated file two generator folders deep and those names can't be cut, so this stays short and independent of where the project lives, for Windows' 260-character path limit. |
|
|
358
|
+
| property | LegacyScratchRoot | `internal static string LegacyScratchRoot { get; }` | 99 | This project's folder in `LegacyScratchBase`. |
|
|
359
|
+
| method | ScratchDirectory | `internal static string ScratchDirectory(long jobId)` | 105 | Folder of dump job `jobId`: `GeneratedFilesDirectory` and `ReplayOutputDirectory`. |
|
|
360
|
+
| method | GeneratedFilesDirectory | `internal static string GeneratedFilesDirectory(long jobId)` | 113 | The compiler's `-generatedfilesout` of dump job `jobId`: nothing but generated files. |
|
|
361
|
+
| method | ReplayOutputDirectory | `internal static string ReplayOutputDirectory(long jobId)` | 122 | The assemblies the replay of dump job `jobId` compiles, as `<Assembly>.dll` and `<Assembly>.ref.dll`. |
|
|
362
|
+
| method | Fnv1a | `internal static uint Fnv1a(string text)` | 131 | 32-bit FNV-1a over the UTF-8 bytes of `text`: the same on every machine and Unity version, unlike a runtime string hash. |
|
|
363
|
+
|
|
364
|
+
### GeneratedCodeDumpProcess
|
|
365
|
+
|
|
366
|
+
```csharp
|
|
367
|
+
internal static class GeneratedCodeDumpProcess
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpProcess.cs:10` (md5: `e703972ca7d43e776b1e85659ad80a91`, lines: 119)
|
|
371
|
+
|
|
372
|
+
Identifies processes by id and start time, so a process id the system reuses for another program is never taken for a dump compiler or for this Editor. No UnityEditor use.
|
|
373
|
+
|
|
374
|
+
**Members:**
|
|
375
|
+
|
|
376
|
+
| Kind | Name | Signature | Line | Summary |
|
|
377
|
+
|------|------|-----------|------|---------|
|
|
378
|
+
| property | CurrentId | `internal static int CurrentId { get; }` | 20 | This Editor's process id. |
|
|
379
|
+
| property | CurrentStartUtcTicks | `internal static long CurrentStartUtcTicks { get; }` | 32 | This Editor's start time in UTC ticks, or 0 when the system does not tell. |
|
|
380
|
+
| method | SameStart | `internal static bool SameStart(long startUtcTicks, long otherStartUtcTicks)` | 44 | True when two recorded start times belong to the same process; an unknown (0) time matches any. |
|
|
381
|
+
| method | StartUtcTicks | `internal static long StartUtcTicks(Process process)` | 51 | |
|
|
382
|
+
| method | IsRunning | `internal static bool IsRunning(int processId, long startUtcTicks)` | 67 | True while process `processId` runs and is the one started at `startUtcTicks`. |
|
|
383
|
+
| method | TryKill | `internal static void TryKill(int processId, long startUtcTicks)` | 91 | Stops process `processId` if it still runs and is the one started at `startUtcTicks`. Never throws. |
|
|
384
|
+
|
|
385
|
+
### GeneratedCodeDumpRsp
|
|
386
|
+
|
|
387
|
+
```csharp
|
|
388
|
+
internal static class GeneratedCodeDumpRsp
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpRsp.cs:12` (md5: `6ec62c5db4822f0ab3cfc88c29224ccd`, lines: 107)
|
|
392
|
+
|
|
393
|
+
Locates Unity's compiler response files: `Library/Bee/artifacts/<hash>.dag/<Assembly>.rsp`. Stale build graphs can sit beside the current one, so the newest file wins. No UnityEditor use.
|
|
394
|
+
|
|
395
|
+
**Members:**
|
|
396
|
+
|
|
397
|
+
| Kind | Name | Signature | Line | Summary |
|
|
398
|
+
|------|------|-----------|------|---------|
|
|
399
|
+
| method | Find | `internal static string Find(string beeArtifactsDir, string assembly)` | 21 | The newest `*.dag/<assembly>.rsp`, or null when there is none. |
|
|
400
|
+
| method | ListAssemblies | `internal static List<string> ListAssemblies(string beeArtifactsDir)` | 53 | Names of every assembly with a response file in the newest build graph (the one holding the newest response file), sorted. |
|
|
401
|
+
| method | ReadArguments | `internal static List<string> ReadArguments(string rspPath)` | 89 | The arguments of `rspPath`, one per line, followed by those of its companion `<Assembly>.rsp2` (per-package `/pathmap`) when there is one: Unity passes both to the compiler, in that order. |
|
|
402
|
+
|
|
403
|
+
### GeneratedCodeDumpSession
|
|
404
|
+
|
|
405
|
+
```csharp
|
|
406
|
+
internal static class GeneratedCodeDumpSession
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpSession.cs:11` (md5: `f040e4a51c465586cfdafba46f95f100`, lines: 65)
|
|
410
|
+
|
|
411
|
+
The session marker, `GeneratedCodeDumpPaths.SessionMarkerFile`: the process id and start time of the Editor that last found the dump on. It tells a domain reload, which keeps the process, from an Editor start or the setting being switched on, which both call for a full dump. No UnityEditor use.
|
|
412
|
+
|
|
413
|
+
**Members:**
|
|
414
|
+
|
|
415
|
+
| Kind | Name | Signature | Line | Summary |
|
|
416
|
+
|------|------|-----------|------|---------|
|
|
417
|
+
| method | ShouldDumpAll | `internal static bool ShouldDumpAll(bool enabled, bool markerIsThisProcess, bool rootExists)` | 17 | Dump every assembly when the dump is on and either this Editor process has not seen it on yet, or the dump folder, `GeneratedCodeDumpPaths.Root`, is missing. |
|
|
418
|
+
| method | FormatMarker | `internal static string FormatMarker(int processId, long processStartUtcTicks)` | 22 | |
|
|
419
|
+
| method | TryParseMarker | `internal static bool TryParseMarker(string text, out int processId, out long processStartUtcTicks)` | 31 | Reads `<process id> [<start ticks>]`; a missing start time reads as 0 (unknown). |
|
|
420
|
+
| method | IsMarkerOf | `internal static bool IsMarkerOf(string markerText, int processId, long processStartUtcTicks)` | 58 | True when `markerText` names the process `processId` started at `processStartUtcTicks`. |
|
|
421
|
+
|
|
422
|
+
### GeneratedCodeDumpSettings
|
|
423
|
+
|
|
424
|
+
```csharp
|
|
425
|
+
internal sealed class GeneratedCodeDumpSettings
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpSettings.cs:19` (md5: `9e362b011ba68e1176e7bf9e64310fab`, lines: 111)
|
|
429
|
+
|
|
430
|
+
Whether the generated-code dump runs for this user in this project, stored as `{"enabled": true}` in `GeneratedCodeDumpPaths.SettingsFile`. Under UserSettings/, Unity's per-user folder, so it survives deleting Library/, Unity's standard .gitignore keeps it out of version control, and each developer turns it on for themselves. Batch mode on the same machine follows it too.
|
|
431
|
+
|
|
432
|
+
**Members:**
|
|
433
|
+
|
|
434
|
+
| Kind | Name | Signature | Line | Summary |
|
|
435
|
+
|------|------|-----------|------|---------|
|
|
436
|
+
| constructor | GeneratedCodeDumpSettings | `internal GeneratedCodeDumpSettings(string path)` | 29 | |
|
|
437
|
+
| property | Current | `internal static GeneratedCodeDumpSettings Current { get; }` | 37 | The settings of this project, re-created after each domain reload. |
|
|
438
|
+
| property | IsEnabled | `internal static bool IsEnabled { get; }` | 40 | |
|
|
439
|
+
| property | Enabled | `internal bool Enabled { get; set; }` | 46 | Re-reads the file when its write time or length changed since the last read. Setting it saves the file atomically, creating its folder. |
|
|
440
|
+
|
|
441
|
+
### GeneratedCodeDumpSettingsFile
|
|
442
|
+
|
|
443
|
+
```csharp
|
|
444
|
+
internal static class GeneratedCodeDumpSettingsFile
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpSettingsFile.cs:14` (md5: `a8960ce56a06cea8c4b438abd0a29d92`, lines: 231)
|
|
448
|
+
|
|
449
|
+
The text of the settings file, `{"enabled": true}`: written and parsed without `JsonUtility`, so the settings watcher can read it off the main thread. No UnityEditor use.
|
|
450
|
+
|
|
451
|
+
**Members:**
|
|
452
|
+
|
|
453
|
+
| Kind | Name | Signature | Line | Summary |
|
|
454
|
+
|------|------|-----------|------|---------|
|
|
455
|
+
| field | EnabledKey | `internal const string EnabledKey` | 16 | |
|
|
456
|
+
| method | Format | `internal static string Format(bool enabled)` | 18 | |
|
|
457
|
+
| method | TryParse | `internal static bool TryParse(string json, out bool enabled)` | 26 | False when `json` is not a flat JSON object with a boolean `enabled` (or none). |
|
|
458
|
+
|
|
459
|
+
### GeneratedCodeDumpSettingsProvider
|
|
460
|
+
|
|
461
|
+
```csharp
|
|
462
|
+
internal sealed class GeneratedCodeDumpSettingsProvider : SettingsProvider
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpSettingsProvider.cs:10` (md5: `ddd410b00c6fb446e055514f5869d16d`, lines: 93)
|
|
466
|
+
**Base:** `SettingsProvider`
|
|
467
|
+
|
|
468
|
+
Preferences page `Preferences/Generated Code Dump`: this user's switch for the generated-code dump, and its output folder.
|
|
469
|
+
|
|
470
|
+
**Members:**
|
|
471
|
+
|
|
472
|
+
| Kind | Name | Signature | Line | Summary |
|
|
473
|
+
|------|------|-----------|------|---------|
|
|
474
|
+
| method | OnGUI | `public override void OnGUI(string searchContext)` | 33 | |
|
|
475
|
+
|
|
476
|
+
### GeneratedCodeDumpSettingsWatcher
|
|
477
|
+
|
|
478
|
+
```csharp
|
|
479
|
+
internal static class GeneratedCodeDumpSettingsWatcher
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpSettingsWatcher.cs:18` (md5: `02a76cee156eec476996bd082d703c80`, lines: 199)
|
|
483
|
+
|
|
484
|
+
Calls back, off the main thread, about 300 ms after the settings file is created, changed, renamed or deleted, so an edit made outside the Editor applies even while the Editor sits in the background. Not used in batch mode.
|
|
485
|
+
|
|
486
|
+
**Members:**
|
|
487
|
+
|
|
488
|
+
| Kind | Name | Signature | Line | Summary |
|
|
489
|
+
|------|------|-----------|------|---------|
|
|
490
|
+
| method | Start | `internal static void Start(Action onChange)` | 34 | |
|
|
491
|
+
| method | Stop | `internal static void Stop()` | 48 | |
|
|
492
|
+
| method | Target | `internal static (string Folder, string Filter) Target(string settingsFile, bool settingsFolderExists)` | 66 | The folder to watch and the name to watch in it for `settingsFile` (a full path): its folder for the file itself, or, while that folder is missing, the folder above for that folder's name. |
|
|
493
|
+
|
|
494
|
+
### GeneratedCodeDumpSyncResult
|
|
495
|
+
|
|
496
|
+
```csharp
|
|
497
|
+
internal sealed class GeneratedCodeDumpSyncResult
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeDumpOutput.cs:84` (md5: `0acc716509ba2c9af0a56aa2cd27cd8c`, lines: 449)
|
|
501
|
+
|
|
502
|
+
What a sync could not do, one line per file with its path under the dump root.
|
|
503
|
+
|
|
504
|
+
**Members:**
|
|
505
|
+
|
|
506
|
+
| Kind | Name | Signature | Line | Summary |
|
|
507
|
+
|------|------|-----------|------|---------|
|
|
508
|
+
| field | TooLong | `internal readonly List<string> TooLong` | 89 | Files skipped, or not written or deleted, because their path is over the OS limit. |
|
|
509
|
+
| field | Failed | `internal readonly List<string> Failed` | 94 | Files that could not be written or deleted, with the reason. |
|
|
510
|
+
|
|
511
|
+
### GeneratedCodeMenuItems
|
|
512
|
+
|
|
513
|
+
```csharp
|
|
514
|
+
internal static class GeneratedCodeMenuItems
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
**Source:** `Assets/Package/GeneratedCodeDump/Editor/GeneratedCodeMenuItems.cs:9` (md5: `0b42131fab839b8fda708545e3416535`, lines: 46)
|
|
518
|
+
|
|
519
|
+
Menu items of the generated-code dump, under Tools/Generated Code Dump/.
|
|
520
|
+
|
|
521
|
+
**Members:**
|
|
522
|
+
|
|
523
|
+
| Kind | Name | Signature | Line | Summary |
|
|
524
|
+
|------|------|-----------|------|---------|
|
|
525
|
+
| method | ToggleEnabled | `internal static void ToggleEnabled()` | 14 | |
|
|
526
|
+
| method | DumpNow | `internal static void DumpNow()` | 27 | |
|
|
527
|
+
| method | OpenFolder | `internal static void OpenFolder()` | 33 | |
|
|
528
|
+
| method | OpenSettings | `internal static void OpenSettings()` | 41 | |
|
|
529
|
+
|
|
530
|
+
<!--
|
|
531
|
+
Used only when api.md is single-file (Step 4 default branch). When chunking
|
|
532
|
+
is active (Step 4 chunked branch), api.md becomes a Contents-table index
|
|
533
|
+
rendered from api-index.md.template, and per-namespace bodies are emitted
|
|
534
|
+
to Documentation~/api/<Namespace>.md from api-chunk.md.template.
|
|
535
|
+
Line 2 is the render stamp (SKILL.md "Output contract"); Step 3.6 re-renders
|
|
536
|
+
this file whenever the scanner or API_RENDER_VERSION differs.
|
|
537
|
+
|
|
538
|
+
Each namespace section follows this exact shape:
|
|
539
|
+
|
|
540
|
+
## `{namespace}`
|
|
541
|
+
|
|
542
|
+
### {fullDisplayName}
|
|
543
|
+
|
|
544
|
+
```csharp
|
|
545
|
+
{declaration — the full header from the manifest, verbatim, possibly multi-line}
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
**Source:** `{file}:{line}` (md5: `{md5}`, lines: {lines})
|
|
549
|
+
**Partial across:** {partialAcross} (omit line unless the type is partial across files)
|
|
550
|
+
**Attributes:** `[Attr1]`, `[Attr2]` (omit line if none)
|
|
551
|
+
**Base:** `{base1}`, `{base2}` (omit if empty)
|
|
552
|
+
|
|
553
|
+
{summary}
|
|
554
|
+
|
|
555
|
+
**Members:**
|
|
556
|
+
|
|
557
|
+
| Kind | Name | Signature | Line | Summary |
|
|
558
|
+
|------|------|-----------|------|---------|
|
|
559
|
+
| method | Foo | `public void Foo()` | 88 | … |
|
|
560
|
+
|
|
561
|
+
Enums get a `**Values:**` table (| Name | Value | Line | Summary |) instead
|
|
562
|
+
of Members; delegates get no table (the csharp block is their signature).
|
|
563
|
+
|
|
564
|
+
The exact shape of the Source parenthetical — `(md5: \`<32-hex>\`, lines: <n>)` —
|
|
565
|
+
is the contract the Step 3.6 fast-update check greps for, on the Source line
|
|
566
|
+
and on every Partial across entry. Do not reflow it (e.g. drop the backticks
|
|
567
|
+
around the hex, swap the order, or put it on a new line) — the check will
|
|
568
|
+
silently stop skipping unchanged namespaces.
|
|
569
|
+
|
|
570
|
+
{partialAcross} lists every non-primary declaration of a partial type in the
|
|
571
|
+
Source shape, comma-separated, ordered by path. For such a type the Members
|
|
572
|
+
position column is `File:Line` (cells like `Context.Entity.cs:55`) and rows
|
|
573
|
+
from every declaration are merged; otherwise members share the type's file and
|
|
574
|
+
the **Line** column gives the line within it. Anchors are the Markdown
|
|
575
|
+
auto-slug of the heading (`### Context<TEntity>` → `contexttentity`) regardless
|
|
576
|
+
of the file/line annotation.
|
|
577
|
+
|
|
578
|
+
Render every type whose effectiveVisibility is public / protected / internal;
|
|
579
|
+
skip private types and types nested in private types. Never omit a rendered
|
|
580
|
+
type: one with no non-private members and no summary gets its heading,
|
|
581
|
+
declaration, Source, Base and "No public members." plus a renderer warning.
|
|
582
|
+
Omit namespaces with no renderable types.
|
|
583
|
+
-->
|