I'm trying to convert some of my internal CLI tools from Xcode projects to Swift packages.
When debugging, I need to be able to start the tool using a custom working directory relative to the project/package directory. I can set this in the scheme config under "Options - Working Directory - Use custom working directory".
It works fine for absolute paths but I can't figure out how to get a relative path (ie. 1 level down from the package directory).
Previously, I used $(PROJECT_DIR)/../
for this but for my Swift package based tools, this just ends up as /
when starting the app. I also tried $(SRCROOT)
but then Xcode even shows an alert The working directory "$(SRCROOT)" for scheme "PackageName" doesn't exist
.
Does anyone know how to achieve this?