Reputation: 1384
In our app we are using cocoapods to keep our config file in a private repo and access the file in build phase like this
CONFIG_FILE="${PODS_ROOT}/My-Repo-Name/swiftlint.yml"
"${PODS_ROOT}/SwiftLint/swiftlint" --config $CONFIG_FILE
Now we are thinking of moving the config file to a swift package, can anyone help to determine how to give a path to the config file in the swift package?
Upvotes: 0
Views: 412
Reputation: 1384
The above answer didn't work but this did
CONFIG_FILE="${BUILD_DIR%Build/*}SourcePackages/checkouts/<repo-name>/Sources/swiftlint.yml"
Upvotes: 0
Reputation: 7170
Bit of a hack, but you might be able to use:
CONFIG_FILE="${BUILD_DIR}/../../SourcePackages/checkouts/My-Repo-Name/swiftlint.yml"
Upvotes: 1