According to the manual: https://documentation.xojo.com/topics/build_automation/ide_scripting/project_commands.html
PropertyValue(propName As String, Assigns value As String)
Gets or sets the value of a project item property. This only works for properties of project items that are part of the Xojo framework (such as Window or App)
Properties of App that can be changed
…
MajorVersion
MinorVersion
BugVersion
StageCode
NonReleaseVersion
AutoIncrementVersionInformation
Version
Copyright
Be sure to use the “App.” prefix in front of any of these properties.
This is my script:
OpenFile "/Users/dirkcleenwerck/Documents/svnsource/rbproject/RBMain/RBMain.xojo_xml_project"
ConstantValue("ProjectFlags.VERSIEUPGRADE") = "24.02.0001"
Print "Wrote 24.02.0001 to ProjectFlags.VERSIEUPGRADE"
PropertyValue("App.MajorVersion") = "2402"
Print "Wrote 2402 to App.MajorVersion"
PropertyValue("App.MinorVersion") = "0001"
Print "Wrote 0001 to App.MinorVersion"
PropertyValue("App.BugVersion") = "1"
Print "Wrote 1 to App.BugVersion"
PropertyValue("App.Version") = "24.02.0001"
Print "Wrote 24.02.0001 to App.Version"
DoCommand("SaveFile")
Print "Project Saved"
It opens the project and changes the constant VERSIEUPGRADE to 24.02.0001
All the prints happen correctly and the project gets saved.
{“tag”:“build”,“response”:“Wrote 24.02.0001 to ProjectFlags.VERSIEUPGRADE”}{“tag”:“build”,“response”:“Wrote 2402 to App.MajorVersion”}
{“tag”:“build”,“response”:“Wrote 0001 to App.MinorVersion”
{“tag”:“build”,“response”:“Wrote 1 to App.BugVersion”}
{“tag”:“build”,“response”:“Wrote 24.02.0001 to App.Version”}
{“tag”:“build”,“response”:“Project Saved”}
Unfortunately, none of the App properties have changed.
Working with Xojo r2023r3 on MacOS Ventura 13.6.3
Any idea what could be going wrong?
This isn’t new. I’m also using “echo home” to set the user like this:
dim theCommand, theResult as string
dim userHome as String = DoShellCommand("echo $HOME")
userHome = Trim(ShellEncode(userHome))
dim basePath as string = userHome + "/Documents/Development/Mail\ Archiver/"
It sounds like the manifest file isn’t being dirtied when those changes happen. You can check this by running your script in 2021r1 and see if it works. Either way, file a bug report.
The reason for the test is that a change was made in summer 2021 that tied project dirtying to the undo system to try to make text project saves only save the things you actually touched. It works, but “what the user touched” is not always black and white.
Unfortunately running the script in 2021r1 didn’t work either.
I don’t know how much use filing a bug report is in this case because it only happens in the project of our main product and unfortunately I’m not allowed to share that one.
Our other projects do not suffer from the problem, so I can’t make it reproducible.
No, I made sure to close everything down before doing the test.
The script does work, because it changes the constant VERSIEUPGRADE and it saves the project at the end.
The only thing that does not work is changing properties of the app, and then only on this project, because when we try the same script with other xojo projects, it works just fine.