Change how & where DLLs are placed to eliminate post-build steps and file location workarounds
Can you write a one-sentence description of your request? Right now, DLLs used by TJAPlayer3 are moved into a dll folder but this slows builds, defeats build caching, complicates test automation, etc.
What is the current behavior? DLLs used by TJAPlayer3 are moved, by post-build events, into a dll folder.
What is the expected behavior? DLLs should either be not moved at all, or at least only moved as part of the CI packaging process, so that localhost and CI build/test can avoid post-build events, test project workarounds, etc.
What is the motivation / use case for changing the behavior?
- Post-build events slow build processes, defeat build caching, etc.
- Moved dependencies are invisible to code, like test automation projects, which is not aware of TJAPlayer3's assembly resolution customization, nor should they be.
- (TJAPlayer3 itself should not even be aware of these file moves, really. If they are to happen (e.g. to make the installation folder appear cleaner) then there are far better mechanisms now available for app packing, extraction to temporary locations, etc. which would go along nicely with some other packaging improvements that would also put us in a better place to perform (semi-)automatic updates, etc.)
For some options if this issue is picked up during/after migration to .NET Core, or even just as inspiration regarding into which folder build should occur and what should get moved and patched where:
- https://github.com/dotnet/runtime/issues/3453
- https://github.com/0xd4d/dnSpy/blob/master/Build/AppHostPatcher/Program.cs
WRT 3453 above, the money shot is in vitek-karas' comment of July 8 2019 (https://github.com/dotnet/runtime/issues/3453#issuecomment-509249471)
<UsingTask TaskName="CreateAppHost" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<Target Name="PostBuild" AfterTargets="PostBuildEvent"
DependsOnTargets="_GetAppHostPaths">
<CreateAppHost AppHostSourcePath="$(AppHostSourcePath)"
AppHostDestinationPath="$(OutputPath)\app.exe"
AppBinaryName="bin\app.dll"
IntermediateAssembly="$(OutputPath)\app.dll"/>
</Target>