-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the way developers can enable Prosit on local builds #2783
Change the way developers can enable Prosit on local builds #2783
Conversation
…e "Model/Prosit/Config/PrositConfig_production.xml" is available, the Skyline Jamfile will always copy it to PrositConfig.xml for embedding in the exe. When the bjam commandline includes "--official" the build still fails if "Model/Prosit/Config/PrositConfig_production.xml" is not available. Also, remove a stale reference to Model\Prosit\Config\UpdatePrositConfiguration.bat in the .csproj file. I'll update the wiki page once this is merged to master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I was thinking of a 3rd name like PrositConfig_override.xml, but I guess this works. It does make it so that dev builds in my release projects will always use PrositConfig_production.xml regardless of whether I have --official. I guess I am okay with that until I come up with a reason it would cause me pain. Nothing comes to mind.
|
Maybe we could just use a different file name like PrositConfig_override.xml
…On Tue, Nov 21, 2023 at 3:33 PM nickshulman ***@***.***> wrote:
I am not sure, but I don't think the Jamfile.jam change is going to do
what you want it to in the case that the "PrositConfig_production.xml" file
is not there.
What you have there is supposed to change the value of
"SKYLINE_PROSIT_CONFIG" if the file could not be found, but if I recall
correctly, that's not how constants work in bjam.
Once a constant has been assigned a value, you cannot change it.
So, "SKYLINE_PROSIT_CONFIG" always ends up being set to
"PrositConfig_production.xml", and the
if ! [ path.exists $(SKYLINE_PROSIT_CONFIG) ]
{
constant SKYLINE_PROSIT_CONFIG : "$(SKYLINE_PATH)/Model/Prosit/Config/PrositConfig_development.xml" ;
}
does not actually do anything.
—
Reply to this email directly, view it on GitHub
<#2783 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYBWUHPI3AEJTXHLPVT37TYFU25PAVCNFSM6AAAAAA7VJ7GI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRRHA3DCMJUGM>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
@@ -343,15 +343,15 @@ if [ modules.peek : NT ] && --i-agree-to-the-vendor-licenses in [ modules.peek : | |||
) > "$(<)" | |||
} | |||
|
|||
constant SKYLINE_PROSIT_CONFIG : "$(SKYLINE_PATH)/Model/Prosit/Config/PrositConfig_production.xml" ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be misremembering how constants work in .jam files, but I kind of remember that you are only allowed to assign a constant a value once.
If you find that this build fails in "PrositConfig_production.xml" is not there, then you might need to change this to:
constant SKYLINE_PROSIT_CONFIG_PRODUCTION : "$(SKYLINE_PATH)/Model/Prosit/Config/PrositConfig_production.xml" ;
if [ path.exists $(SKYLINE_PROSIT_CONFIG_PRODUCTION) ]
{
constant SKYLINE_PROSIT_CONFIG : $(SKYLINE_PROSIT_CONFIG_PRODUCTION) ;
}
else if --official in [ modules.peek : ARGV ]
{
errors.user-error "PrositConfig_production.xml must be present for an official build" ;
}
else
{
constant SKYLINE_PROSIT_CONFIG : "$(SKYLINE_PATH)/Model/Prosit/Config/PrositConfig_development.xml" ;
}
But, if the build works correctly when "PrositConfig_production.xml" is not there, then it means I was wrong.
(I have tried to test this on my own computer and am just getting myself more confused)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't remember myself whether constant works that way but it was easy enough to test:
constant foo : "Constants are really constant" ;
constant foo : "Constants can be changed" ;
echo $(foo) ;
Echoes "Constants can be changed".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. As far as I can tell, the thing that I was worried about is not true.
If a file "Model/Prosit/Config/PrositConfig_production.xml" is available, the Skyline Jamfile will always copy it to PrositConfig.xml for embedding in the exe. When the bjam commandline includes "--official" the build still fails if "Model/Prosit/Config/PrositConfig_production.xml" is not available.
Also, remove a stale reference to Model\Prosit\Config\UpdatePrositConfiguration.bat in the .csproj file.
I'll update the wiki page once this is merged to master.