UserGuide

IDE Scripting Constants

From Xojo Documentation

These constants can be used in Build Step IDE Scripts.

AppSupportsDarkMode As Boolean

Returns True if the app is built with Supports Dark Mode property set to ON.

AppSupportsHiDPI As Boolean

Returns True if the app is built with Supports HiDPI property set to ON.

CurrentBuildTargetIs32Bit As Boolean

Returns True when doing a 32-bit build.

CurrentBuildTargetIs64Bit As Boolean

Returns True when doing a 64-bit build.

CurrentBuildTargetIsARM As Boolean

Returns True when doing a build for a the ARM CPU architecture.

CurrentBuildTargetIsConsole As Boolean

Returns True when building a Console app.

CurrentBuildTargetIsDesktop As Boolean

Returns True when building a Desktop app.

CurrentBuildTargetIsIntel As Boolean

Returns True when doing a build for the Intel CPU architecture (x86 or x86-64).

CurrentBuildTargetIsIOS As Boolean

Returns True when building an iOS app.

CurrentBuildTargetIsLinux As Boolean

Returns True when doingn a Linux build.

CurrentBuildTargetIsMacOS As Boolean

Returns True when doing a macOS build.

CurrentBuildTargetIsWeb As Boolean

Returns True when building a Web app.

CurrentBuildTargetIsWindows As Boolean

Returns True when doing a Windows build.

CurrentBuildTargetIsXojoCloud As Boolean

Returns True when doing a Xojo Cloud build.

DebugBuild As Boolean

Indicates if the app is being run in debug mode (True) or as a Build (False).

Sample Code

Update an App constant to indicate the number of debug runs:

If DebugBuild Then
If SelectProjectItem("App") Then
// Constant kDebugRuns must exist on App
Var value As Integer = Val(ConstantValue("kDebugRuns")) + 1
ConstantValue("kDebugRuns") = value.ToString
End If
End If

PreBuild As Boolean

Returns True if the script is running before the Build step.

TargetLinux As Boolean

Indicates if the Xojo IDE is running on Linux.

TargetMacOS As Boolean

Indicates if the Xojo IDE is running on a Mac.

Sample Code

If the project is being built on a Mac, then code sign it:

If TargetMacOS Then
Var command As String
command = "codesign -f --deep -s ""Developer ID Application: YourName "" ""YourXojoApp.app """
Var result As String
result = DoShellCommand(command)
End If

TargetWindows As Boolean

Indicates if the Xojo IDE is running on Windows.

Sample Code

If the project is being built on Windows, start Inno Setup after the build is finished:

If TargetWindows Then
Var innoSetupPath As String
innoSetupPath = """C:\Program Files (x86)\Inno Setup 5/Compil32.exe"""
Var result As String
Var resultCode As Integer
result = DoShellCommand(innoSetupPath, 20000, resultCode)
End If