SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

SwiftPlugins setup doesn't work when specifying "clonedSourcePackagesDirPath" in xcodebuild

Open grzegorzkrukowski opened this issue 1 year ago • 1 comments
trafficstars

New Issue Checklist

Bug Description

The setup mentioned in the docs for SwiftPlugin doesn't work when executed with clonedSourcePackagesDirPath: xcodebuild -clonedSourcePackagesDirPath ".build"

SWIFT_PACKAGE_DIR="${BUILD_DIR%Build/*}SourcePackages/artifacts"
SWIFTLINT_CMD=$(ls "$SWIFT_PACKAGE_DIR"/swiftlintplugins/SwiftLintBinary/SwiftLintBinary.artifactbundle/swiftlint-*/bin/swiftlint | head -n 1)

if test -f "$SWIFTLINT_CMD" 2>&1
then
    "$SWIFTLINT_CMD"
else
    echo "warning: `swiftlint` command not found - See https://github.com/realm/SwiftLint#installation for installation instructions."
fi

Packages are then stored in a that folder, not the %BUILD_DIR.

Environment

  • SwiftLint version: any
  • Xcode version: 15.0, 16.0
  • Installation method used: SwiftLintPlugins

grzegorzkrukowski avatar Oct 08 '24 17:10 grzegorzkrukowski

There seems to be no variable in Xcode that points to the alternative package directory. In this case, the only thing that can be done is to update the README mentioning that this only works with the default package location.

Or have you found a solution, @grzegorzkrukowski?

SimplyDanny avatar Oct 11 '24 22:10 SimplyDanny