I have created a script that I would like to run when any platform is built. I know I can drag my script into the OS X build section, or Windows build section, but is there a place I can add my script that will execute it when building any platform?
I can’t seem to find a way to do so. It would be a great feature though.
There isn’t
We also had one monster script like that that we broke into three platform specific ones since there were starting to be far too many #if Target type conditionals in it
Hm, my script has zero conditionals in it. It just sets some properties:
[code] Dim s As String
s = Trim(DoShellCommand(“cd “”$PROJECT_PATH”" && cat .git/refs/heads/master"))
ConstantValue(“App.GitRevision”) = s
PropertyValue(“App.ShortVersion”) = PropertyValue(“App.MajorVersion”) + “.” + _
PropertyValue(“App.MinorVersion”) + “.” + PropertyValue(“App.BugVersion”)
PropertyValue(“App.LongVersion”) = PropertyValue(“App.ProductName”) + _
" v" + PropertyValue(“App.ShortVersion”) + _
" build " + PropertyValue(“App.NonReleaseVersion”) + _
". " + ConstantValue(“App.Copyright”)[/code]
A feature request would be in order
Not sure how we’d do it so the steps run in a well defined order
I can see how that would be difficult. Maybe the best solution is one that works right now w/o too much difficulty. I modified my script:
[code] Dim s As String
s = Trim(DoShellCommand(“cd “”$PROJECT_PATH”" && cat .git/refs/heads/master"))
If ConstantValue(“App.GitRevision”) <> s Then
Speak “Versioning Updated”
ConstantValue(“App.GitRevision”) = s
PropertyValue("App.ShortVersion") = PropertyValue("App.MajorVersion") + "." + _
PropertyValue("App.MinorVersion") + "." + PropertyValue("App.BugVersion")
PropertyValue("App.LongVersion") = PropertyValue("App.ProductName") + _
" v" + PropertyValue("App.ShortVersion") + _
" build " + PropertyValue("App.NonReleaseVersion") + _
". " + ConstantValue("App.Copyright")
End If
[/code]
I then saved it as an External Script, which I then included multiple times into each Target that I build, exactly where I want it to run (before build).
thats about the simplest for now
one source you reuse
Create an external script and then set each target to call that external script.