realm / jazzy

Soulful docs for Swift & Objective-C
https://realm.io
MIT License
7.35k stars 413 forks source link

iOS only SPM won't build #1375

Closed simonmcl closed 11 months ago

simonmcl commented 11 months ago

I'm trying to use jazzy docs for an SPM package, that is iOS only (mainly due to a dependency). When trying to run jazzy, the build errors saying the macos versions of dependencies are mismatched. I want to tell jazzy to build iOS only. I've tried using the flag to say iphoneos but it doesn't seem to restrict the build. Is there something else I can do?

My package:

let package = Package(
    name: "xxxxxxxxx",
    platforms: [
        .iOS("15.0")
    ],
    ....

Command:

jazzy --root-url xxxxxx --output Documentation
jazzy --root-url xxxxxx --output Documentation --sdk iphoneos
jazzy --root-url xxxxxx --output Documentation --sdk iphoneos --swift-build-tool spm

All produce the same errors:

My library is listed as "requiring 10.13", which it doesn't, this must be default if its unsupplied. I can't add a value for mine, because then it won't compile as it doesn't work for Macos

error: the library 'CustomAuth' requires macos 10.15, but depends on the product 'JWTDecode' which requires macos 11.0; consider changing the library 'CustomAuth' to require macos 11.0 or later, or the product 'JWTDecode' to require macos 10.15 or earlier.
error: the library 'xxxxx' requires macos 10.13, but depends on the product 'yyyyy' which requires macos 11.0; consider changing the library 'xxxxx' to require macos 11.0 or later, or the product 'yyyyy' to require macos 10.13 or earlier.
error: the library 'xxxxx' requires macos 10.13, but depends on the product 'Kingfisher' which requires macos 10.14; consider changing the library 'xxxxx' to require macos 10.14 or later, or the product 'Kingfisher' to require macos 10.13 or earlier.
error: the library 'xxxxx' requires macos 10.13, but depends on the product 'CustomAuth' which requires macos 10.15; consider changing the library 'xxxxx' to require macos 10.15 or later, or the product 'CustomAuth' to require macos 10.13 or earlier.
johnfairh commented 11 months ago

What command are you using to build the module outside of jazzy? You'll need to pass those same flags to it -- right now it just knows to run swift build.

(The --sdk flag is something to do with Objective-C and isn't doing anything here.)

simonmcl commented 11 months ago

@johnfairh I had no command line scripts for building it. After some googling I found the solution was to force jazzy to use xcodebuild and have to use a .jazzy.yaml file, so that you can use comma separated string for -destination. Need settings something like the below to force it to stop building for macos:

root_url: xxxxx
output: Documentation
swift_build_tool: xcodebuild
xcodebuild_arguments:
  - "-scheme"
  - "xxxxx"
  - "-destination"
  - "platform=iOS Simulator,OS=16.2,name=iPhone 14 Pro"

Thanks for responding anyway