You are already using it for the simulator. You need to look up the options for the --sdk parameter if you want to use it against a specific device. Maybe --sdk iphone
@jonprescott I don't need it for the device. I want to compile it for the simulator, but the parameters above doesn't work. This parameters still produce a lot of macOS mentions in the logs. That's the issue. I need to correct parameters to avoid all the macOS mentions from the logs.
Otherwise it seems like diagnose-api-breaking-changes still does some part of job (for example, compilation) for the MacOS instead of iOS simulator.
Could you provide correct command line for iOS simulator?
I always get the message "No breaking changes detected in TestPackage" When I am 100% I have introduced breaking changes.
I have tested that adding iOS sdk options to the command always produces this result, even when I don't have any iOS related code and do not have any platform set in the Package.swift file.
Without changing any code after running the command mentioned above, when I run the same command without the additional options:
swift package diagnose-api-breaking-changes d1730d8
I get the following result:
1 breaking change detected in TestPackage:
💔 API breakage: struct Person has been removed
So clearly adding these options prevents the diagnose-breaking-changes from working properly.
Step 3: Repeat steps 1 & 2 for the "old" version of the API to test against
Step 4: Use swift api-digester -diagnose-sdk to compare the JSON files and spit out a report
swift api-digester -diagnose-sdk --input-paths old.json --input-paths new.json
I'm still testing whether xcodebuild can work instead. Also, to make this viable you'd probably have to write something that parsed the output of -diagnose-sdk. Presumably this could be kind of stupid, though, the output looks like this:
/* Generic Signature Changes */
/* RawRepresentable Changes */
/* Removed Decls */
Protocol Cache has been removed
Var DIFactory.cache has been removed
/* Moved Decls */
/* Renamed Decls */
/* Type Changes */
/* Decl Attribute changes */
/* Fixed-layout Type Changes */
/* Protocol Conformance Change */
/* Protocol Requirement Change */
/* Class Inheritance Change */
/* Others */
So my gut says you could strip the known comment lines and empty lines from the file, then pass anything remaining to stderr with a little emoji to get the same behavior.