Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate docs for packages depending on UIKit #5555

Closed
kylebrowning opened this issue May 25, 2022 · 5 comments
Closed

Can't generate docs for packages depending on UIKit #5555

kylebrowning opened this issue May 25, 2022 · 5 comments
Assignees

Comments

@kylebrowning
Copy link

@kylebrowning kylebrowning commented May 25, 2022

I can get my package to build and run with UIKit via some command line arguments,

-Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios14.0-simulator"

But this doesn't seem to work for swift package Any ideas?

@ethan-kusters
Copy link

@ethan-kusters ethan-kusters commented May 31, 2022

Thanks for raising this @kylebrowning! I believe this reproduces with swift build on the command-line as well so is a general SwiftPM issue separate from the Swift-DocC Plugin specifically. I'm going to transfer this issue over there to see if the SwiftPM folks have any suggestions.

For documentation specifically, you can look into xcodebuild docbuild on the command-line as well: https://developer.apple.com/documentation/xcode/distributing-documentation-to-external-developers.

@ethan-kusters ethan-kusters transferred this issue from apple/swift-docc-plugin May 31, 2022
@tomerd
Copy link
Member

@tomerd tomerd commented May 31, 2022

@neonichu does this sound familiar?

@neonichu
Copy link
Member

@neonichu neonichu commented May 31, 2022

This isn't really supported, so I would use xcodebuild for anything involving iOS.

@nonameplum
Copy link

@nonameplum nonameplum commented Jun 9, 2022

I have the same issue, I'm able to build the documentation directly using Swift DocC and swift build though.

rm -rf .build;
mkdir -p .build/symbol-graphs \
  && swift build --target UIEnvironment \
    -Xswiftc "-sdk" \
    -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" \
    -Xswiftc "-target" \
    -Xswiftc "arm64-apple-ios15.4-simulator" \-Xswiftc -emit-symbol-graph \
    -Xswiftc -emit-symbol-graph-dir -Xswiftc .build/symbol-graphs;
mkdir -p .build/swift-docc-symbol-graphs \
  && mv .build/symbol-graphs/UIEnvironment* .build/swift-docc-symbol-graphs;
export DOCC_HTML_DIR="$(dirname $(xcrun --find docc))/../share/docc/render";
rm -rf docs-out;
mkdir -p docs-out/main \
  && ../swift-docc/.build/debug/docc convert Sources/UIEnvironment/Documentation.docc \
  --fallback-display-name UIEnvironment \
  --fallback-bundle-identifier com.plum.UIEnvironment \
  --fallback-bundle-version 1.0.0 \
  --additional-symbol-graph-dir .build/swift-docc-symbol-graphs \
  --transform-for-static-hosting \
  --hosting-base-path /UIEnvironment/main \
  --output-path docs-out/main;
cp -R docs-out/main main

Asked the same question on Apple forums https://developer.apple.com/forums/thread/707599
It seems like using xcodebuild docbuild will be a solution once the Xcode 14 will be available on github actions

xcodebuild docbuild -scheme <scheme-name> \
    -derivedDataPath '.build/derived-data/' \
    -destination 'generic/platform=iOS' \
    DOCC_HOSTING_BASE_PATH='/UIEnvironment/main'

find '.build/derived-data' -type d -name '*.doccarchive'

@neonichu
Copy link
Member

@neonichu neonichu commented Jun 15, 2022

Going to close this, as xcodebuild is the intended way to interact with packages targeting iOS.

@neonichu neonichu closed this as not planned Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants