Buld script for all platforms in one step

Is there a way to build for all platforms in one step eg. build one and it builds them all.

Rather than having to manually select the 64 bit of everything then build, then select ARM versions and build, then 32 bit etc.

1 Like

You can use BuildApp with the different architecture values. In between builds you need to move the result to a different location. The real problem is that AppWrapper is asynch.

Wouldn’t it be great if Xojo had the platforms as headings with check boxes underneath for every type of available build, so you could just select everything you need and hit Build.

1 Like

I have a script that does a multi-build:

path = BuildApp(kOSXUniversal64, False) 'comment until Universal plugins are compiled, else we get NilObjectException and have to force quit!
path = BuildApp(kWin32, False)
path = BuildApp(kWin64, False)
path = BuildApp(kLin64, False)
path = BuildApp(kLin32ARM, True)

the only problem is that it wipes out the previous builds as it builds the next ones. Is there any way to stop this auto-delete or change the destination of a build?

No. but you could add all of those paths to an array and then move them to another location after the build.

I tried to add the following code to my build XojoScript, but I get a compile error on the first line.

How are you supposed to ‘move them to another location after the build’ if you can’t view another location?

Var dest As FolderItem = SpecialFolder.Documents 'compile error at least on this line!

If dest = Nil Or Not dest.Exists Then Return
dest = dest.Child("Compiled apps") 'this folder exists
If dest = Nil Or Not dest.Exists Then Return

path = BuildApp(kOSX64, False)
Var f As FolderItem = FolderItem(path, FolderItem.PathModes.Shell)

If f = Nil Or Not f.Exists Then Return
f.MoveTo(Dest)

You can’t use FolderItems in scripts. Try using a shell command with DoShellCommand.

Yes, that works, thank you.