im adding Periphery in Project.swift using tuist like this:
.target(
name: "\(TargetName.periphery)",
destinations: .macOS,
product: .framework,
bundleId: "",
sources: [],
scripts: [
.pre(
script: "./Tools/periphery/run_periphery.sh",
name: "Run Periphery",
basedOnDependencyAnalysis: false
)
],
settings: .settings(base:
["ASSETCATALOG_COMPILER_APPICON_NAME": "",
"DEFINES_MODULE": "NO"])
)
And it works perfect. But when im building target Periphery (cmd+B) to run scripе I get an error: No such module "NameOfMyMainTarget" in my tests where im using @testable import "NameOfMyMainTarget" (If i build my main scheme so it was builded success)
If i remove these files with tests which contains -> @testable import "NameOfMyMainTarget" Periphery works good, but how i can build project with these files?
my part of run_periphery.sh script:
xcrun --sdk macosx "$PERIPHERY_BIN" scan --verbose \
--project "$ROOT_DIR/NameOfMyMainTarget.xcworkspace" \
--schemes NameOfMyMainTarget \
--retain-public \
--retain-unused-protocol-func-params \
--clean-build \
--format xcode \
-- \
build \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,id=$SIMULATOR_UDID" \
CODE_SIGNING_ALLOWED=NO \
ENABLE_BITCODE="NO" \
COMPILER_INDEX_STORE_ENABLE="YES" \
INDEX_ENABLE_DATA_STORE="YES" \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
EXPANDED_CODE_SIGN_IDENTITY="" \
EXPANDED_CODE_SIGN_IDENTITY_NAME="" \
EXPANDED_PROVISIONING_PROFILE=""