A Swift Package Manager Plugin for SwiftGen that will run it before each build
SwiftGen has its own implementation
Add the package as a dependency to your Package.swift
:
dependencies: [
.package(url: "https://github.com/mshurkin/SwiftGenPlugin", from: "6.6.2"),
]
Then add SwiftGenPlugin
plugin to your targets:
targets: [
.target(
name: "YOUR_TARGET",
dependencies: [],
plugins: [
.plugin(name: "SwiftGenBuildPlugin", package: "SwiftGenPlugin")
]
),
Add this package to your project dependencies. Select a target and open the Build Phases
inspector. Open Run Build Tool Plug-ins
and add SwiftGenBuildPlugin
from the list.
Plugin look for a swiftgen.yml
configuration file in the root of your package (in the same folder as Package.swift
) and in the target's folder. If files are found in both places, the file in the target's folder is preferred.
The paths in the configuration depend on where it is located:
- Root configuration requires a full path to resources. You can set
${TARGET_NAME}
instead of a specific target name, such asSources/${TARGET_NAME}/Resources/en.lproj/Localizable.strings
- Target configuration requires a relative path to resources
SwiftGenPlugin is released under the MIT license. See LICENSE file for more info.