Closed Allje closed 2 years ago
You can modify the configured build phase (or manually add another one) to invoke the generator with the --project
option.
I have looked at the links you specified, but I can't get it working.
Can you pls. provide an example of how to configure it with --project based on the example I provided?
You would modify the run script build phase installed on DeviceATests
to include a call to the generator similar to:
"${SRCROOT}/Pods/MockingbirdFramework/mockingbird" generate \
--project "${SRCROOT}/Common/Common.xcodeproj" \
--srcroot "${SRCROOT}/Common" \
--targets Common \
--output "${SRCROOT}/MockingbirdMocks/DeviceATests-CommonMocks.generated.swift"
And then update the Mockingbird build phase to include DeviceATests-CommonMocks.generated.swift
as an output file + add it to the compile sources build phase.
I have a Xcode workspace that includes two Xcode projects. The structure following
I can install mockingbird for DeviceA with following command: iOSApplication/DeviceA$ mockingbird install -- target DeviceATests --source DeviceA
The problem is that DeviceA uses a protocol (ProtocolA) defined in the common folder and I can't install mockingbird for that interface. I have tried with following command iOSApplication/DeviceA$ mockingbird install -- target DeviceATests --source ../Common/Common but I get this error: malformedConfiguration(description: "Unable to find source target named \'../Common/Common\'")
I have also tried to use a absolute path to Common, but that also doesn't work. Is it not possible to mock a file from another project?
Environment
mockingbird version
): 0.17.0swift --version
): Apple Swift version 5.4.2.mockingbird-ignore
? No