Now I’m a bit more awake. There are 2 parts for building:
- An IDE communicator script to build the apps:
dim basePath as string = userHome + “/Documents/Development/Mail\ Archiver/”
[code]'do scheduler
openfile(basePath + “code\ current/max\ scheduler.xojo_xml_project”)
if BuildApp(16) = “” then
return
else
DoCommand “SaveFile”
DoCommand(“CloseWindow”)
end if
'main app
openfile(basePath + “code\ current/max.xojo_xml_project”)
if BuildApp(16) = “” then
return
else
DoCommand “SaveFile”
DoCommand(“CloseWindow”)
end if[/code]
And so on.
- The apps have IDE scripts to copy the helpers into the correct place:
[code]'copy the scheduler to app/library/loginitems
'no scheduler for lite
if ConstantValue(“App.kMaxVersion”) = “2” then Return
dim appPath as string = currentBuildLocation + “/” + shellEncode(currentBuildAppName)
if right(AppPath, 4) <> “.app” then appPath = appPath + “.app”
'do directory for loginitems
dim cmd as String = "/bin/mkdir -p " + appPath + “/Contents/Library/LoginItems”
dim theOutput as string = doShellCommand(cmd)
if theOutput <> “” then print theOutput
'get path to scheduler
dim CountSlashes as integer = CountFields(ProjectShellPath, “/”)
dim ProjectName as string = NthField(ProjectShellPath, “/”, CountSlashes)
dim ProjectPath as String = Left(ProjectShellPath, Len(ProjectShellPath) - Len(ProjectName))
dim PathToScheduler64 as String = ProjectPath + shellEncode(“Builds - max scheduler/OS X 64 bit”)
'copy scheduler to app
cmd = "usr/bin/ditto " + PathToScheduler64 + " " + appPath + “/Contents/Library/LoginItems”
'print "cmd " + cmd
theOutput = doShellCommand(cmd)
if theOutput <> “” and instr(theOutput, “can’t get real path”) = 0 then print theOutput
// Helper functions for this script
Function shellEncode(inValue as string) as string
Dim rvalue as string = replaceAll(inValue, " ", "\ ")
rvalue = replaceAll(rvalue, “&”, “\&”)
rvalue = replaceAll(rvalue, “-”, “\-”)
rvalue = replaceAll(rvalue, “(”, “\(”)
rvalue = replaceAll(rvalue, “)”, “\)”)
return rvalue
End Function[/code]
The code isn’t especially robust because I have to set the paths manually. But the code doesn’t change too often so it’s not much of a problem.