Copy built-in resources to "OutputPath" only when needed#632
Draft
pzhlkj6612 wants to merge 2 commits intoCnCNet:developfrom
Draft
Copy built-in resources to "OutputPath" only when needed#632pzhlkj6612 wants to merge 2 commits intoCnCNet:developfrom
pzhlkj6612 wants to merge 2 commits intoCnCNet:developfrom
Conversation
The conditions are:
- It's being debugged;
- It's DXMainClient;
- It's cross-targeting build ('$(TargetFramework)' == ''). Don't know the whole story, just from my guess:
- https://github.com/dotnet/msbuild/blob/b497794a81585d40ba5401acde02200f7b7d863b/src/Tasks/Microsoft.Managed.Before.targets
- https://github.com/dotnet/msbuild/blob/b497794a81585d40ba5401acde02200f7b7d863b/src/Tasks/Microsoft.Common.CrossTargeting.targets
- No "ClientDefinitions.ini" in destination.
|
Nightly build for this pull request:
|
The conditions are:
- It's being debugged;
- It's ClientCore or DTAConfig or DXMainClient;
- It's cross-targeting build ('$(TargetFramework)' == ''). Don't know the whole story, just from my guess:
- https://github.com/dotnet/msbuild/blob/b497794a81585d40ba5401acde02200f7b7d863b/src/Tasks/Microsoft.Managed.Before.targets
- https://github.com/dotnet/msbuild/blob/b497794a81585d40ba5401acde02200f7b7d863b/src/Tasks/Microsoft.Common.CrossTargeting.targets
- No "ClientDefinitions.ini" in destination.
Contributor
Author
|
Without the $ find . -path '*/bin/*' -name 'SUN.ini'
./ClientCore/bin/Debug/YR/WindowsDX/SUN.ini
./ClientGUI/bin/Debug/YR/WindowsDX/SUN.ini
./ClientUpdater/bin/Debug/YR/WindowsDX/SUN.ini
./DTAConfig/bin/Debug/YR/WindowsDX/SUN.ini
./DXMainClient/bin/Debug/YR/WindowsDX/SUN.ini
./TranslationNotifierGenerator/bin/Debug/YR/WindowsDX/SUN.ini
for d in 'ClientCore' 'ClientGUI' 'ClientUpdater' 'DTAConfig' 'DXMainClient' 'TranslationNotifierGenerator'; do
echo "dir($d) = $(grep -rnw 'Resources' --include '*.cs' ./$d | wc -l)";
done
After briefly reading the code of the above projects, I think we only need the copied resources for these projects:
. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi.
Commit message
Why
I've seen the "SUN.INI" file multiple times when playing with YR client. So today I did a search in the project root directory:
Oh, they are too many, aren't they?
After doing some testing, I think we need to tweak the "CopyResources" target by adding more conditions, so I did it in this PR.
Change
After applying this PR, the built-in resources will be copied to the
bin\Debug\$(Game)\$(Engine)directory, so the binary of both net8.0 and non-net8.0 will share the same game files.Question
I can see the duplicated
SearchResourcesDir(string startupPath)functions in both DXMainClient and ClientCore modules:xna-cncnet-client/ClientCore/ProgramConstants.cs
Lines 118 to 144 in bae3855
My question is: do we need those resources during debugging ClientCore? If so, I think I may need to change the condition statement.