Skip to content

Commit

Permalink
Fixed docfx build issue (maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
space928 committed Dec 29, 2023
1 parent 72d094f commit 67b68ba
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 178 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,4 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
/OmsiHook/log.txt
docfx_log.txt
3 changes: 2 additions & 1 deletion OmsiHook/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
/**/packages/
/**/bin/
/**/obj/
_site
/**/_site/
docfx_log.txt
21 changes: 12 additions & 9 deletions OmsiHook/OmsiHook.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" />

<PropertyGroup>
<BuildDocFx>true</BuildDocFx>
<DocfxConfigFile>$(MSBuildProjectDirectory)/docs/docfx.json</DocfxConfigFile>
Expand Down Expand Up @@ -66,15 +66,12 @@
<PackagePath>\lib\net6.0</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<!-- <PackageReference Include="DhyMik.DocFx.UpdateDocFxVersionAttributeTask" Version="1.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="docfx.console" Condition="'$(Configuration)'!='Debug'" Version="2.59.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PackageReference Include="docfx.console" Version="2.59.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<GeneratePathProperty>True</GeneratePathProperty>
</PackageReference>
<PackageReference Include="memberpage" Version="2.59.4" />
</ItemGroup>
Expand All @@ -86,4 +83,10 @@
<ProjectReference Include="..\OmsiHookRPCPlugin\OmsiHookRPCPlugin.csproj" />
</ItemGroup>

<!--Hack to fix docfx build bug... For some reason sometimes docfx tries to load the wrong version of System.Memory.dll; as
a workaround we can delete docfx's copy of System.Memory.dll and let it use MSBuild's one which *should* work.-->
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="set &quot;DocFXMemory=$(Pkgdocfx_console)\tools\System.Memory.dll&quot;&#xD;&#xA;if exist &quot;%25DocFXMemory%25&quot; (&#xD;&#xA; echo &quot;Applying docfx build workaround (deleting docfx's copy of System.Memory.dll)...&quot;&#xD;&#xA; del /q &quot;%25DocFXMemory%25&quot;&#xD;&#xA;) else (&#xD;&#xA; echo &quot;DBG: File doesn't exist %25DocFXMemory%25&quot;&#xD;&#xA;)" />
</Target>

</Project>
2 changes: 1 addition & 1 deletion OmsiHook/OmsiRemoteMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public static async Task OmsiSoundTrigger(OmsiComplMapObjInst mapObj, string tri
{
var triggerPtr = memory.AllocateString(trigger);
var filenamePtr = memory.AllocateString(filename);
Task.WaitAll(triggerPtr, filenamePtr);
await Task.WhenAll(triggerPtr, filenamePtr);
await OmsiSoundTrigger(mapObj, triggerPtr.Result, filenamePtr.Result);
}

Expand Down
Loading

0 comments on commit 67b68ba

Please sign in to comment.