planet-cheese
planet-cheese

Reputation: 41

SwiftGen integration with SPM for Localization

I'm trying to integrate SwiftGen Plugin using SPM within a project that has multiple packages for localization. So I picked the package where I need SwiftGen and did the following:

  1. I've performed all the steps highlighted at here.
  2. Configured .yml file like this:
input_dir: Sources/Example/Resources
output_dir: Sources/Example/Generated

strings:
  inputs:
    - en.lproj
  outputs:
    - templateName: structured-swift5
      output: Strings.generated.swift
  1. When I try to run I get Plug-in ended with non-zero exit code: 1) with error: **Error: You don’t have permission to save the file “Strings.generated.swift” in the folder “Generated”. **

What am I doing wrong?

I tried to change the output folder but nothing, same thing.. I can't find any resource on the web regarding on how to integrate SwiftGen for localization within an existing SPM package.

Upvotes: 1

Views: 1099

Answers (1)

kien-hoang
kien-hoang

Reputation: 41

You should use it as command

swift package --allow-writing-to-package-directory generate-code-for-resources

Upvotes: 1

Related Questions