XcodeGen icon indicating copy to clipboard operation
XcodeGen copied to clipboard

`executable` in Run Action not setting properly

Open piotrsmajek opened this issue 3 years ago • 5 comments

I have configuration with other app added to project byprojectReferences

projectReferences:
  xyz:
    path: ../Modules/xyz/xyz.xcodeproj

and I set

schemes:
  xyz:
    build:
      targets:
        xyz/xyz: all
    run:
      executable: "xyz/xyz"

According to the documentation: image

 executable: "xyz"

or

 executable: "xyz.app"

Not working too

And in project I have settings like this after xcodegen generate image image

Executable is missing 👎 How can I add this properly?

piotrsmajek avatar Sep 01 '22 12:09 piotrsmajek

✚𝟏

bartosz-pawelczyk avatar Sep 01 '22 12:09 bartosz-pawelczyk

@keith @yonaskolb

bartosz-pawelczyk avatar Sep 07 '22 13:09 bartosz-pawelczyk

Sill an issue in 2024 and the metadata for run schema is ignoring executable completely.

https://github.com/yonaskolb/XcodeGen/blob/2a367acb0f7928bc42210cbcdd31dcd778831c6b/Sources/ProjectSpec/Scheme.swift#L176-L194

morissonmaciel avatar Mar 28 '24 22:03 morissonmaciel

From looking briefly at the code, setting the executable will only currently work if it's set to the name of another target that the scheme builds. But it doesn't currently support if that target comes from another project.

yonaskolb avatar Apr 07 '24 13:04 yonaskolb

Changes would be required here, to not just lookup targets by name but support full TargetReference's that the build targets now support

https://github.com/yonaskolb/XcodeGen/blob/1645d419ce9abdcfaa3d917aabd7e2c9dc317fba/Sources/XcodeGenKit/SchemeGenerator.swift#L219-L234

yonaskolb avatar Apr 07 '24 13:04 yonaskolb