Custom (release)build folder

Hi,

I need to build the same console-App about 10 times, each time with a different target name.
I used and IDE script to:

set the App name = targetName+".exe"
set the bundle identifier = targetName
Call BuildApp(kplatformConstantForWindows64bit)

However all the targetNames need to be build for the same platform and the platform specific buildfolder gets cleared before each build.
So I end up with only the last target
Can I somehow change the (release)build-folder-path ?

You need an IDE communicator script. This gives you the possibility to change name and bundle identifier for each build. Below is the start of my own script:

[code]dim MaxVersion as String = “0”
if MaxVersion = “” then MaxVersion = “0”

dim MajorVersion as string = “5”
dim MinorVersion as String = “1”
dim BugVersion as String = “0”
dim BetaVersion as String = “b1”

dim basePath as string
basePath = “/Users/beatrixwillius\ 1/Documents/Development/Mail\ Archiver/”

'delete old apps and dmg
dim theCommand as string = "osascript " + basePath + “code\ current/ide\ communicator/delete\ old\ builds.scpt”
dim theResult as String = DoShellCommand(theCommand)

'scheduler: only for normal and pro
if MaxVersion = “0” or MaxVersion = “1” then
openfile(basePath + “code\ current/max\ scheduler.xojo_xml_project”)
ConstantValue(“App.kMaxVersion”) = MaxVersion
if ConstantValue(“App.kMaxVersion”) = “0” then
PropertyValue(“App.Application Identifier”) = “com.mothsoftware.mailarchiverx-helper”
PropertyValue(“App.MacOSXAppName”) = "Mail Archiver X "
elseif ConstantValue(“App.kMaxVersion”) = “1” then
PropertyValue(“App.Application Identifier”) = “com.mothsoftware.mailarchiverxpro-helper”
PropertyValue(“App.MacOSXAppName”) = "Mail Archiver X Pro "
else
print ConstantValue(“App.kMaxVersion”)
end if
makeVersion(MajorVersion, MinorVersion, BugVersion, BetaVersion)
if BuildApp(16) = “” then
return
else
DoCommand “SaveFile”
DoCommand(“CloseWindow”)
end if
end if[/code]

[quote=438049:@Jan Verrept]Hi,

I need to build the same console-App about 10 times, each time with a different target name.
I used and IDE script to:

set the App name = targetName+".exe"
set the bundle identifier = targetName
Call BuildApp(kplatformConstantForWindows64bit)

However all the targetNames need to be build for the same platform and the platform specific buildfolder gets cleared before each build.
So I end up with only the last target
Can I somehow change the (release)build-folder-path ?[/quote]

Or after each build simply rename the one that got built

@Norman Palardy: 10 times???

in a script why not ?

I’m trying to copy my release builds to a ‘Products’-Folder after each build now.

is it normal for “currentBuildLocation” to return an empty string after an OSX build?
The post build script below works great under windows but not with OSX because of the empty currentBuildLocation.

[code]Dim shellCommand As String
Dim result as String = ProjectShellPath

dim targetBuildFolders() as string = currentBuildLocation.split("/")
dim platFormBuildFolders() as String
for buildFolderLevel as Integer = 0 to targetBuildFolders.ubound-1
platFormBuildFolders.append(targetBuildFolders(buildFolderLevel))
next buildFolderLevel
dim platFormBuildPath as string = platFormBuildFolders.join("/")

dim productFolder as String = “$PROJECT_PATH/Products/”

shellCommand = "cp -r “+platFormBuildPath +” "+productFolder
result = DoShellCommand(shellCommand)

shellCommand = "rm -rf "+platFormBuildPath
result = DoShellCommand(shellCommand)[/code]

Which version of macOS? Which version of Xojo? It’s the other way around: currentBuildLocation only makes sense after building.

And only if it builds successfully.

You might want to check and see if that environment variable is actually available. My suspicion is that it’s actually empty in the IDE.

Thnx

somehow my post-build-script was dragged into a pre-build script.
I feel so stupid now. All works as expected.