yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
6.88k stars 809 forks source link

Integration with R.Swift #1399

Closed razor313 closed 7 months ago

razor313 commented 10 months ago

I'm trying to use R.swift in my project and add it in the packages as well as in the buildToolPlugins as the following code, but it wasn't in the Run Build Tool Plug-ins section after generating *.xcproject file. Did I define it wrong?

Xcodegen: 2.32.0 Xcode: 14.3

packages:
  RswiftGenerator:
    url: https://github.com/mac-cain13/R.swift
    from: 7.3.2
targets:
  MyApp:
    buildToolPlugins:
      - plugin: RswiftGenerateInternalResources
        package: RswiftGenerator
vicajilau commented 9 months ago

I suggest you take a look at the scripts that xcodegen allows you to generate within each target. Something like this:

image

I hope this helps you 😃

roman-aliyev commented 8 months ago

Try the example bellow with xcodegen 2.37.0:

targets:
  MyApp:
    ...
    dependencies:
      - package: Rswift
        product: RswiftLibrary
    buildToolPlugins:
      - package: Rswift
        plugin: RswiftGenerateInternalResources
packages:
  Rswift:
    url: https://github.com/mac-cain13/R.swift
    from: 7.3.2

Also you might consider the plugin within a local package. See the conceptual example here -> mac-cain13/R.swift#838 . Corresponding manifest:

targets:
  MyApp:
    ...
    dependencies:
      - package: RswiftPlugin
        product: RswiftPluginDependencies
    buildToolPlugins:
      - package: RswiftPlugin
        plugin: RswiftPlugin
packages:
  RswiftPlugin:
    path: Packages/RswiftPlugin
razor313 commented 7 months ago

Now xcodegen supports Add support for adding build tool plugins to targets #1374 🚀