Building commands
These commands are related to building projects.
BuildApp(buildType As Integer [, reveal As Boolean]) As String
Starts building the current project.
The buildType can be one of these values:
Value |
Build Target |
32/64-bit |
Architecture |
---|---|---|---|
3 |
Windows |
32-bit |
Intel |
4 |
Linux |
32-bit |
Intel |
9 |
macOS Universal |
64-bit |
Intel & ARM |
12 |
Xojo Cloud |
32-bit |
Intel |
13 |
iOS Simulator |
64-bit |
Intel |
14 |
iOS Device |
64-bit |
ARM |
16 |
macOS (all) |
64-bit |
Intel |
17 |
Linux |
64-bit |
Intel |
18 |
Linux |
32-bit |
ARM |
19 |
Windows |
64-bit |
Intel |
21 |
Android Emulator |
64-bit |
ARM |
23 |
Android Device |
64-bit |
ARM |
24 |
macOS |
64-bit |
ARM |
25 |
Windows |
64-bit |
ARM |
26 |
Linux |
64-bit |
ARM |
If reveal is True, the built app is displayed using the OS file manager.
Returns a String containing the Shell path of the built app.
BuildApp cannot be used in an IDE Script that is called by a Build Automation Script.
The code displays the location of a Mac build:
Var appPath As String
appPath = BuildApp(16) ' Mac 64-bit build
Print("Built: " + appPath)
BuildCurrentPlatform As Boolean
Gets or sets whether to build the project for the current OS platform.
BuildLanguage As String
Used to get or set the build language. This is the “Language” property on the Shared Build Settings.
Change the language to English:
If BuildLanguage = "Default" Then
BuildLanguage = "English"
End If
BuildLinux As Boolean
Gets or sets whether to build the project for Linux.
This is also set to true when "This Computer" is selected and Xojo is running on Linux.
Create a Linux build:
BuildLinux = True
DoCommand("BuildApp")
BuildMac As Boolean
Gets or sets whether to build the project for macOS.
This is also set to true when "This Computer" is selected and Xojo is running on macOS.
Build for Mac, but not Windows:
BuildMac = True
BuildWin32 = False
DoCommand("BuildApp")
BuildWebDebugPort As Integer
Gets or sets the web port for running debug apps.
Set the debug port:
BuildWebDebugPort = 8100
BuildWebPort As Integer
Gets or sets the web port for built apps.
Use a value of -1 to choose a port automatically.
Set the port:
BuildWebPort = 8080
BuildWin32 As Boolean
Gets or sets whether to build the project for Windows.
This is also set to true when "This Computer" is selected and Xojo is running on Windows.
Build for Windows, but not Mac:
BuildMac = False
BuildWin32 = True
DoCommand("BuildApp")
CancelBuild
Cancels the current build in IDE Pre-Build Scripts. In a Post-Build script this is ignored.
Cancel a build:
CancelBuild
CurrentBuildAppName As String (read-only)
Returns the name of the app that was built. This can only be used in a Build Automation IDE Script that runs after the Build Step. This just the app name, so spaces and other special characters are not escaped.
Note
For macOS apps, this includes the full appname and extension.
Display the built app's name:
Print(CurrentBuildAppName)
CurrentBuildLocation As String (read-only)
Returns the shell path to the app that was built. This can only be used in a Build Automation IDE Script that runs after the Build Step. Since this is a shell path, spaces and other special characters are properly escaped.
Display the built app's shell path:
Print(CurrentBuildLocation)
CurrentBuildLocationNative As String (read-only)
Returns the native (unescaped) path to the app that was built. This can only be used in a Build Automation IDE Script that runs after the Build Step.
Display the built app's native path:
Print(CurrentBuildLocationNative)
CurrentBuildTarget As Integer (read-only)
Returns an integer that specifies the type of app that was built. This can only be used in a Build Automation IDE Script that runs after the Build Step.
The return value is one of these values:
Value |
Build Target |
32/64-bit |
Architecture |
---|---|---|---|
3 |
Windows |
32-bit |
Intel |
4 |
Linux |
32-bit |
Intel |
9 |
macOS Universal |
64-bit |
Intel & ARM |
12 |
Xojo Cloud |
32-bit |
Intel |
14 |
iOS Simulator |
64-bit |
Intel |
15 |
iOS |
64-bit |
ARM |
16 |
Mac (all) |
64-bit |
Intel |
17 |
Linux |
64-bit |
Intel |
18 |
Linux |
32-bit |
ARM |
19 |
Windows |
64-bit |
Intel |
21 |
Android Emulator |
64-bit |
ARM |
23 |
Android Device |
64-bit |
ARM |
24 |
macOS |
64-bit |
ARM |
25 |
Windows |
64-bit |
ARM |
Get the value for the target that was built:
Var result As Integer = CurrentBuildTarget
PropertyValue(String) As String
Allows you to set some attributes of the build target.
Names |
Values |
---|---|
App.MacArchitecture, App.WindowsArchitecture, App.LinuxArchitecture |
x32, x64, ARM32, ARM64 |
macOSMinimumVersion |
A version string - for example: 13.0.1 |
If the property doesn't support the value passed, the build target will be unchanged.
This example sets the macOS architecture to x64:
PropertyValue("App.MacArchitecture") = "x64"