Skip to content

Commit 388942e

Browse files
claudeNormandErwan
authored andcommitted
refactor: move DocFxForUnity.csproj into Documentation/
Simplifies setup: users only need to copy one folder (Documentation/) instead of a folder plus a separate file at the project root. - Add explicit Compile glob (../Assets/**/*.cs) since the SDK default no longer covers Assets/ from the new location - Fix lib/UnityEngine fallback path to ../lib/UnityEngine - Update docfx.json metadata src from ".." to "." - Update README accordingly https://claude.ai/code/session_017hjwp9DHW2Sh6ZNhMF2Lbs
1 parent 9c5a321 commit 388942e

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.1</TargetFramework>
4+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
45
</PropertyGroup>
56

7+
<ItemGroup>
8+
<Compile Include="../Assets/**/*.cs" />
9+
</ItemGroup>
10+
611
<Target Name="AddUnityReferences" BeforeTargets="ResolveAssemblyReferences">
712
<!--
813
Priority 1: UNITY_MANAGED_PATH environment variable (explicit override).
@@ -14,7 +19,7 @@
1419
<!-- Priorities 1 & 2: explicit path -->
1520
<PropertyGroup>
1621
<UnityManagedPath Condition="'$(UNITY_MANAGED_PATH)' != ''">$(UNITY_MANAGED_PATH)</UnityManagedPath>
17-
<UnityManagedPath Condition="'$(UnityManagedPath)' == '' and Exists('$(MSBuildProjectDirectory)/lib/UnityEngine')">$(MSBuildProjectDirectory)/lib/UnityEngine</UnityManagedPath>
22+
<UnityManagedPath Condition="'$(UnityManagedPath)' == '' and Exists('$(MSBuildProjectDirectory)/../lib/UnityEngine')">$(MSBuildProjectDirectory)/../lib/UnityEngine</UnityManagedPath>
1823
</PropertyGroup>
1924

2025
<!-- Collect DLLs from explicit path (priorities 1 or 2) -->

Documentation/docfx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"src": [
55
{
6-
"src": "..",
6+
"src": ".",
77
"files": [
88
"DocFxForUnity.csproj"
99
]

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,18 @@ online: <https://normanderwan.github.io/DocFxForUnity/>. It references both C# A
2020
## Setup your documentation
2121

2222
1. [Install DocFX](https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html#2-use-docfx-as-a-command-line-tool).
23-
2. Copy the `Documentation/` folder and `DocFxForUnity.csproj` to your Unity project:
23+
2. Copy the `Documentation/` folder to your Unity project:
2424

2525
```diff
2626
.
2727
├── Assets
28-
+ ├── DocFxForUnity.csproj
2928
+ ├── Documentation
3029
├── Package
3130
├── ProjectSettings
3231
└── README.md
3332
```
3433

35-
You can rename `DocFxForUnity.csproj` to match your project — just update the filename in `Documentation/docfx.json` under `metadata[0].src[0].files` accordingly.
34+
You can rename `Documentation/DocFxForUnity.csproj` to match your project — just update the filename in `Documentation/docfx.json` under `metadata[0].src[0].files` accordingly.
3635

3736
3. Edit the following properties in `Documentation/docfx.json`, keep the others as it is:
3837

@@ -139,7 +138,7 @@ details.
139138

140139
- DocFX outputs: `Warning:[ExtractMetadata]No project detected for extracting metadata.`
141140

142-
Solution: Make sure you copied `DocFxForUnity.csproj` (or your renamed version) to the root of your Unity project, and that the filename matches the entry in `Documentation/docfx.json` under `metadata[0].src[0].files`.
141+
Solution: Make sure `DocFxForUnity.csproj` (or your renamed version) is inside the `Documentation/` folder, and that the filename matches the entry in `Documentation/docfx.json` under `metadata[0].src[0].files`.
143142

144143
- DocFX outputs: `Warning:[ExtractMetadata]No metadata is generated for Assembly-CSharp,Assembly-CSharp-Editor.`
145144

@@ -170,7 +169,7 @@ details.
170169

171170
## Advanced: `UNITY_MANAGED_PATH`
172171

173-
By default, `DocFxForUnity.csproj` auto-detects the Unity managed DLLs from the standard Unity Hub installation directory. Set `UNITY_MANAGED_PATH` when you need to:
172+
By default, `Documentation/DocFxForUnity.csproj` auto-detects the Unity managed DLLs from the standard Unity Hub installation directory. Set `UNITY_MANAGED_PATH` when you need to:
174173

175174
- Use a Unity version installed at a non-default location.
176175
- Pin to a specific version when multiple Unity versions are installed.

0 commit comments

Comments
 (0)