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

How to include files in my dependent frameworks. #1276

Closed
onato opened this issue Sep 15, 2021 · 2 comments
Closed

How to include files in my dependent frameworks. #1276

onato opened this issue Sep 15, 2021 · 2 comments
Labels

Comments

@onato
Copy link

onato commented Sep 15, 2021

I have my modules organized in frameworks that are linked into the App Target, similar to this example project.

DemoAppWithFramework.zip

Screen Shot 2021-09-16 at 10 37 28 AM

When I run…

❯ jazzy --version
jazzy version: 0.14.0

❯ jazzy --min-acl private
Running xcodebuild
Checking xcodebuild -showBuildSettings
Assuming New Build System is used.
Parsing AppDelegate.swift (1/3)
Parsing SceneDelegate.swift (2/3)
Parsing ViewController.swift (3/3)
0% documentation coverage with 14 undocumented symbols
included 14 private, fileprivate, internal, public, or open symbols
building site
building search index
jam out ♪♫ to your fresh new docs in `docs`

I get documentation generated for the files in the main App target, but not for those in the framework.

Screen Shot 2021-09-16 at 10 27 00 AM

I expected jazzy to generate docs for files in the app target's dependencies as well.

Do I need to generate the docs for frameworks in a separate step using https://github.com/realm/jazzy#docs-from-swiftmodules-or-frameworks or is there something else I am missing?

@johnfairh johnfairh added the help label Sep 16, 2021
@johnfairh
Copy link
Collaborator

johnfairh commented Sep 16, 2021

Running jazzy this way generates documentation for one module - see Usage in the readme for tips on how to pick the right module.

If you want to try putting multiple modules into the same docset then see #1194, #564 for the workaround -- things should mostly work as long as your structure is not too complex and there are no name clashes.

@onato
Copy link
Author

onato commented Sep 22, 2021

Worked like a charm.

#!/bin/sh
set -euo pipefail
IFS=$'\n\t'

modules=(
    "App"
    "Authentication"
    "Utils"
  )

cleanup() {
    for module in ${modules[@]}; do
        rm "$module.json" || true
    done
}
trap cleanup 0

FILENAMES=""
for module in ${modules[@]}; do
    filename="$module.json"
    if [ ! -f $filename ]; then
        echo "Processing $module"
        sourcekitten doc -- -workspace MyApp.xcworkspace -scheme "$module" > "$filename"
    fi
    FILENAMES="$FILENAMES,$filename"
done

jazzy \
  --clean \
  --author Acme \
  --author_url https://example.com \
  --source-host github \
  --source-host-url https://github.com/example/my-app \
  --build-tool-arguments -scheme,MyApp \
  --root-url https://github.com/example/my-app/ \
  --output docs/reference \
  --min-acl private \
  --sourcekitten-sourcefile "${FILENAMES:1}"

@onato onato closed this as completed Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants