Skip to content
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

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

bspratt
Copy link
Member

@bspratt bspratt commented Nov 21, 2023

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.

…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.
Copy link
Contributor

@brendanx67 brendanx67 left a 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.

@nickshulman
Copy link
Contributor

nickshulman commented Nov 21, 2023

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.

@brendanx67
Copy link
Contributor

brendanx67 commented Nov 21, 2023 via email

@@ -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" ;
Copy link
Contributor

@nickshulman nickshulman Nov 22, 2023

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)

Copy link
Member

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".

Copy link
Contributor

@nickshulman nickshulman left a 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.

@bspratt bspratt merged commit 1bcc3d9 into master Nov 22, 2023
@bspratt bspratt deleted the Skyline/work/20231121_prosit_config_for_developers branch November 22, 2023 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants