Generate docs and files for static websites #146
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The initial idea for this PR comes from wanting better documentation around UniFFI.
Since this repo is handling building the
swift
components fromapplication-services
, this is the right place to facilitate this endeavor. We have loosely coupled.swift
files we would like to get documentation out and serve them on a web server.However, Swift is not allowing us to strip-out the doc comments and serve them on as a static website.
These are the steps involved:
Package.swift
setup so we are able to build a full project. The existing one (fromapplication-services
) is not able to do so..xcframework
file from an existingapplication-services
repository..xcodeproject
file and generate a.doccarchive
.doccarchive
, which can be browsed through locally, we need to generate a static-website.application-services
, we need to find the right CI/CD environment to build the NSS package + the XCode dependencies.xcodeproject
file is generated, we need to be able to generate a.doccarchive
in the CI/CD workflow and generate static website files from itAll files are under
automation/build-docs
.Milestones
Package.swift
file to addGlean
as a dependency, and updated it toiOSv15
. Afterwards, I was able to build a.xcodeproject
from a localapplication-services
project..doccarchive
and generate a static website from it:Moving this to the CI/CD platform, there are many, many challenges:
brew
installation ofPython
.application-services
comes with build scripts, which will installx86_64
, andarm64
dependencies. As well as it installs theios-simulator
target onx86_64
, which broke the countless builds in many different ways.The only solution I could see was to "overwrite" the build scripts from
application-services
and apply them during build time in the GitHub workflow:These overwrites remove all
ios-simulator
andx86_64
targets, and just build forarm64
.We then can go ahead and setup the build environment:
cd /tmp/application-services ./libs/verify-ios-ci-environment.sh
Roadblock
Folder and file names of the generated static website contain not valid characters:
Many folders and files are named
!=(_:_:)
, and:
is not allowed as part of the filename.