I’m reworking some old post-build IDE Scripts for handling things like codesigning and packaging and it’s getting complex having to deal with all of the new locations that we get with the various platform types. To assist in simplifying this, I’ve submitted feature request <https://xojo.com/issue/44131> to add a AppBuildShellPath property that actually points to the built app folder.
Please adopt and comment if this is something that would be useful to you.
I’m currently getting the ProjectShellPath and then adding the sub folders to the app’s folder manually - such as:
Dim theRes As String
Function getCurrentBuildLocation() as String
dim s, sa(), projname, pathdelim as string
//Set the delimiter for the path based on the platform
if TargetWin32 then
pathdelim = "\"
else
pathdelim = "/"
end if
//Get the project path
s = ProjectShellPath
//Split into items
sa = split(s,pathdelim)
//Retrieve the project name so we can use it later
projname = sa(UBound(sa))
//Remove the project name
sa.remove(UBound(sa))
//Add the builds folder
sa.append "Builds\\ \\-\\ " + projname
//Join the array to create the new path
s = join(sa,pathdelim)
return s
End Function
theRes = DoShellCommand("codesign --deep -s ""Developer ID Application: TOLIS Group, Inc."" " + getCurrentBuildLocation + "/Mac\\ OS\\ X\\ \\(Cocoa\\ Intel\\)/BRU\\ PE.app", 40000)
If theRes <> "" Then
Print "Issue with codesign" + EndOfLine + theRes
Else
theRes = DoShellCommand("codesign -vv " + getCurrentBuildLocation + "/Mac\\ OS\\ X\\ \\(Cocoa\\ Intel\\)/BRU\\ PE.app", 40000)
Print "codesign successful" + EndOfLine + EndOfLine + theRes
End If
Since the build path will be known since you have to create the path to do the build, it would be known before or after the build and this should be a non-issue.
The IDE says “build the mac os x cocoa 32 bit version HERE” and gives it a “base name”
The compiler tells the IDE, after building , I built THIS here - it literally returns a folder item to the IDE
So the IDE cant 100% accurately calculate the name at any point before the build happens because the compiler CAN and MAY change the absolute path (like by stuffing it into a directory in the build folder during a debug run etc)
The BEST you could get is where the IDE thinks it would be built (the folder)
And of course not using build folders makes things different
So while this might not affect YOU what is possible has to take all these things into account to try & do the right thing
Okay, can we at least get a property that will provide the proposed build folder so we don’t have to play that game of manually constructing the path as above?