bundleID for app in MAS and "myStore"

I would like to be able to manage one piece of code in Xojo to produce an app for sale both on MAS as well as on my own store, using IDE scripts to change the necessary added components etc for each.

My question is does each variant of the app need its own unique bundleID e.g. com.domain.myApp and com.domain.myAppMAS?

If so, how would you programatically change the bundleID (and hence Mac App Name) for each variant of the software?

If not, how can they both be tested within the same environment.

I have found part of the answer - which is to use the following in a build script to identify the bundleID.

dim bundleID as string = propertyValue(“App.Application Identifier”)

print s

At least now I can just change the bundleID to trigger different build scripts.