-
Notifications
You must be signed in to change notification settings - Fork 226
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
add way to generate docs for an SPM module #211
Conversation
Dreamy, I was researching some of this last night 👍 |
mkdir -p "/tmp/SourceKitten.dst/usr/local/Frameworks" "/tmp/SourceKitten.dst/usr/local/bin"
mv -f "/tmp/SourceKitten.dst/Applications/sourcekitten.app/Contents/Frameworks/SourceKittenFramework.framework" "/tmp/SourceKitten.dst/usr/local/Frameworks/SourceKittenFramework.framework"
mv -f "/tmp/SourceKitten.dst/Applications/sourcekitten.app/Contents/MacOS/sourcekitten" "/tmp/SourceKitten.dst/usr/local/bin/sourcekitten"
rm -rf "/tmp/SourceKitten.dst/Applications/sourcekitten.app"
pkgbuild \
--component-plist "Source/sourcekitten/Components.plist" \
--identifier "com.sourcekitten.SourceKitten" \
--install-location "/" \
--root "/tmp/SourceKitten.dst" \
--version "0.12.2" \
"SourceKitten.pkg"
pkgbuild: Reading components from Source/sourcekitten/Components.plist
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Result.framework
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/YamlSwift.framework
pkgbuild: error: Component path "/tmp/SourceKitten.dst/usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/YamlSwift.framework" does not exist.
make: *** [package] Error 1 |
Patch for fixing above error: diff --git a/Source/sourcekitten/Components.plist b/Source/sourcekitten/Components.plist
index 90b2284..0679bf7 100644
--- a/Source/sourcekitten/Components.plist
+++ b/Source/sourcekitten/Components.plist
@@ -19,7 +19,7 @@
<key>BundleOverwriteAction</key>
<string></string>
<key>RootRelativeBundlePath</key>
- <string>/usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/YamlSwift.framework</string>
+ <string>/usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Yaml.framework</string>
</dict>
<dict>
<key>BundleOverwriteAction</key> After fixed above error, mkdir -p "/tmp/SourceKitten.dst/usr/local/Frameworks" "/tmp/SourceKitten.dst/usr/local/bin"
mv -f "/tmp/SourceKitten.dst/Applications/sourcekitten.app/Contents/Frameworks/SourceKittenFramework.framework" "/tmp/SourceKitten.dst/usr/local/Frameworks/SourceKittenFramework.framework"
mv -f "/tmp/SourceKitten.dst/Applications/sourcekitten.app/Contents/MacOS/sourcekitten" "/tmp/SourceKitten.dst/usr/local/bin/sourcekitten"
rm -rf "/tmp/SourceKitten.dst/Applications/sourcekitten.app"
pkgbuild \
--component-plist "Source/sourcekitten/Components.plist" \
--identifier "com.sourcekitten.SourceKitten" \
--install-location "/" \
--root "/tmp/SourceKitten.dst" \
--version "0.12.2" \
"SourceKitten.pkg"
pkgbuild: Reading components from Source/sourcekitten/Components.plist
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Result.framework
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Yaml.framework
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework
pkgbuild: Adding component at usr/local/Frameworks/SourceKittenFramework.framework
pkgbuild: error: Path "/tmp/SourceKitten.dst/usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Yaml.framework" is not a valid bundle component (using destination path "/tmp/SourceKitten.dst")
make: *** [package] Error 1 And I filed behrang/YamlSwift#27 for fixing the |
YamlSwift's build configuration has been updated behrang/YamlSwift#27 (comment). |
Wow, thanks for identifying and fixing all these issues @norio-nomura! You're amazing! I also haven't been unable to reproduce behrang/YamlSwift#26 with Release builds, so I can live with this limitation for now. |
This adds a way to easily document SPM packages. However, there's a stack overflow issue in the yaml parser library I'm using to parse the Swift Package Manager's build info (behrang/YamlSwift#26), which means that packages that generate a yaml file over ~350 lines has a decent chance of crashing.
You can then run jazzy on the output:
Which generates this: https://static.realm.io/jazzy_demo/Vapor