Build Automation Questions

Hey guys,

I’d love to create a quite extensive build automation script, but unfortunately the documentation lacks a lot info about it. It says I could just record the steps that I would like to do, but unfortunately I can find that feature no where.

I am building a webApp, and would love to automatically build it as standalone and CGI everytime I hit the build button.

Here is what I would like to do:

Change the Build folder to “/bla/builds/buildNumber/StandAlone”
Build it as Standalone with Port 8080 (Also, is there an option to change the port number while the app is running?)
Change the Build folder to “/bla/builds/buildNumber/CGI”
Then build it as CGI for all targets using the “Auto Select Port” setting.

Cheers and thanks,
Denis

To record steps in the IDE, select File->IDE Scripts->New IDE Script.

No, but you can specify a different port when you launch the app: http://documentation.xojo.com/index.php/WebApplication.Port

I don’t see a way to change the Deployment Type or Port using Build Automation, so go ahead and add a feature request to Feedback for those.

Hi Paul,

thanks. Would be great if you update the Docs accordingly, since when you add a script via Insert -> Build Step -> Script the editor doesnt show up.

But nonetheless, the XojoScript Editor doesnt record anything I’m doing in my xojo window; however it does record when I am selecting the script editor window.

Also, can you confirm the copy files step in the build automation works in xojo 2013r3.1 ? It doesnt over here.

Cheers and thanks,
Denis

But is there a way to set the build Location? The docs dont say if the build path is a readOnly variable, also it seems to be generated during runtime as it doesnt show up as possible option in the script editor.

No, you cannot change the build location. The CurrentBuildLocation value is read-only.

You could use an IDE Script with a Shell command to copy the build to a new location, I suppose.

As the recorder in Xojo 2013r3.1 didnt seem to work right, I recorded this here in RealStudio, which basically works like a charme:

[code] // Build as CGI

PropertyValue(“App.Application Identifier”) = “com.name.productCGI”

beep

SelectWindow “projectName”
DoCommand “BuildSettings”
BuildWin32 = True
BuildLinux = True
BuildMacMachOx86 = True
BuildMacCocoa = False

// Build as CGI
BuildWebProtocol = 0

//Automatic Port
BuildWebPort = -1
BuildWebDebugPort = 8080

//Build
DoCommand “SaveFileAs”
DoCommand “BuildApp”

// Build as StandAlone

PropertyValue(“App.Application Identifier”) = “com.name.product”

SelectWindow “projectName”
DoCommand “BuildSettings”

BuildWin32 = True
BuildLinux = True
BuildMacMachOx86 = True
BuildMacCocoa = False

// Build as StandAlone
BuildWebProtocol = 1

//Port 8080
BuildWebPort = 8080
BuildWebDebugPort = 8080

//Build
DoCommand “SaveFileAs”
DoCommand “BuildApp”

// Overwrite old Project
DoCommand “SaveFileAs”
[/code]

But - Is there a way to define where save as should save the project to? Otherwise I’ll probably just copy the project using shell scripts.
Also, it seems the only way to run this at the moment is to copy it into the IDE Script editor and press run. Is this correct?
Can you confirm that BuildStepCopyFiles works?

Nevermind about the Build Step thing; just RTFM… Very unintuitive… :-/

So far it almost works to my satisfaction, except that this build script (which is placed after the build itself) doesnt work because it can not build the app because it is run while the compiler is still busy with linking. Any Ideas to make that work?
[/quit]
Remove the BuildApp and put it BEFORE the build

I want to build Linux twice, once as standalone and once as CGI. Thats why the CGI is behind the build step. Btw, why did you edit the post? :slight_smile:

Pressed the wrong darned icon

Each entry in the targets is ONE complete build and the compiler is BUSY for the whole duration
You can’t make it build a second time using build automation

You can’t change the port of a cgi app at launch. If you do, it will disconnect from the cgi and shut down.

not changing the port during launch anyway :slight_smile: It would be way cool if you could add multiple other build steps as well… :slight_smile:

You can add many steps to any build - but that builds ONE executable.
What you can’t do is add another target, say a second Linux, OS X or Windows target, with a different set of steps so you could select both and have it build two different Linux, OS X or Windows executable.

Denis, I think it deserves to create a Feedback. I will vote for it.

Indeed, it would be convenient to quickly and easily generate several executables.

For example:

I have a webServer with 20 instances of a web app, each with a different port.
If Xojo could spawn 20 instances (each with its port) in one step, it would be practical. There would just send them to the server.

you can change the port when you launch the standalone web app, but it is much less convenient. With each update, it will restart each instance by manually specifying the port.

Instead of build automation you can use IDE script
BuildApp command is synchronous.

After build rename (via DoShellCommand) the relative build folder

Actually, there is a feedback case for multiple targets already; #17907 - I just saw it now. For some reason I didnt get any notifications that there have been additional replies in here…