Skip to content

Commit 5a3aff3

Browse files
committed
Code Commit
1 parent 9ae1fb4 commit 5a3aff3

File tree

4,373 files changed

+2122104
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,373 files changed

+2122104
-2
lines changed

.cache/jb/UpdateWork.dat

3.82 KB
Binary file not shown.

.cache/jb/version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(ssh://git@git.jetbrains.team/llvm/llvm-project.git f4157ca9dd49181f6d35eaf6d324ffa84a40f01b based on LLVM 31f1590e4fb324c43dc36199587c453e27b6f6fa revision)

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# Auto detect text files and perform LF normalization
2-
* text=auto
1+
gyb/* linguist-vendored

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [stackotter]
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Compile docs
2+
description: 'A reusable fragment that compiles Codira documentation for a target'
3+
inputs:
4+
target:
5+
description: 'Target to compile documentation for'
6+
required: true
7+
use-swiftpm:
8+
description: 'If true, use SwiftPM to compile documentation'
9+
symbol-graph-dir:
10+
# If use-swiftpm is false, then you must provide this or use-symbol-graph-artifact
11+
description: 'Directory containing extracted symbol graphs'
12+
use-symbol-graph-artifact:
13+
# If use-swiftpm is false, then you must provide this or symbol-graph-dir
14+
description: 'If true, download symbol graphs from the [target]-symbol-graphs artifact'
15+
docc-catalog:
16+
# If not provided, a dummy catalog is created.
17+
description: 'DocC catalog containing DocC articles etc'
18+
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Reject invalid inputs
23+
if: ${{ (inputs.use-swiftpm == 'true' && (inputs.symbol-graph-dir != '' || inputs.use-symbol-graph-artifact == 'true' || inputs.docc-catalog != '')) || (inputs.use-swiftpm != 'true' && (inputs.symbol-graph-dir != '') == (inputs.use-symbol-graph-artifact == 'true')) }}
24+
run: |
25+
echo "target: $TARGET"
26+
echo "use-swiftpm: $USE_SWIFTPM"
27+
echo "symbol-graph-dir: $SYMBOL_GRAPH_DIR"
28+
echo "use-symbol-graph-artifact: $USE_SYMBOL_GRAPH_ARTIFACT"
29+
echo "docc-catalog: $DOCC_CATALOG"
30+
exit 1
31+
shell: bash
32+
env:
33+
TARGET: ${{ inputs.target }}
34+
USE_SWIFTPM: ${{ inputs.use-swiftpm }}
35+
SYMBOL_GRAPH_DIR: ${{ inputs.symbol-graph-dir }}
36+
USE_SYMBOL_GRAPH_ARTIFACT: ${{ inputs.use-symbol-graph-artifact }}
37+
DOCC_CATALOG: ${{ inputs.docc-catalog }}
38+
39+
- name: Compile documentation (with SwiftPM)
40+
if: ${{ inputs.use-swiftpm == 'true' }} # Compare to constant to treat empty input as false
41+
run: |
42+
set -ex
43+
code package \
44+
--allow-writing-to-directory . \
45+
generate-documentation \
46+
--target "$TARGET" \
47+
--disable-indexing \
48+
--transform-for-static-hosting \
49+
--hosting-base-path code-cross-ui \
50+
--output-path "$TARGET.doccarchive" \
51+
--source-service github \
52+
--source-service-base-url https://github.com/stackotter/code-cross-ui/blob/main \
53+
--checkout-path $(pwd) \
54+
--verbose
55+
shell: bash
56+
env:
57+
TARGET: ${{ inputs.target }}
58+
59+
- name: Download symbol graphs (from artifact)
60+
if: ${{ inputs.use-symbol-graph-artifact == 'true' }}
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: ${{ inputs.target }}-symbol-graphs.tar.gz
64+
65+
- name: Extract symbol graphs artifact
66+
if: ${{ inputs.use-symbol-graph-artifact == 'true' }}
67+
uses: a7ul/tar-action@v1.1.0
68+
with:
69+
command: x
70+
files: ./${{ inputs.target }}-symbol-graphs.tar.gz
71+
72+
- name: Compile documentation (with DocC)
73+
if: ${{ inputs.use-swiftpm != 'true' }}
74+
shell: bash
75+
run: |
76+
set -eux
77+
catalog="$DOCC_CATALOG"
78+
if [[ $catalog == "" ]]; then
79+
catalog="$TARGET.docc"
80+
mkdir "$catalog"
81+
fi
82+
symbol_graph_dir="$SYMBOL_GRAPH_DIR"
83+
if [[ $symbol_graph_dir == "" ]]; then
84+
symbol_graph_dir="$TARGET-symbol-graphs"
85+
fi
86+
echo $symbol_graph_dir
87+
xcrun docc convert "$catalog" \
88+
--additional-symbol-graph-dir $symbol_graph_dir \
89+
--transform-for-static-hosting \
90+
--hosting-base-path code-cross-ui \
91+
--output-path "$TARGET.doccarchive" \
92+
--source-service github \
93+
--source-service-base-url https://github.com/stackotter/code-cross-ui/blob/main \
94+
--checkout-path .
95+
env:
96+
TARGET: ${{ inputs.target }}
97+
DOCC_CATALOG: ${{ inputs.docc-catalog }}
98+
SYMBOL_GRAPH_DIR: ${{ inputs.symbol-graph-dir }}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Extract symbol graphs
2+
description: 'A reusable fragment that extract Codira symbol graphs and optionally uploads them as artifacts'
3+
inputs:
4+
target:
5+
description: 'Target to compile documentation for'
6+
required: true
7+
upload:
8+
# Assumed false if omitted. We could supply the 'default' field, but it doesn't take
9+
# effect when this composite action is called from a workflow, so it would just be
10+
# misleading.
11+
description: 'Whether to upload the documentation as an artifact or not'
12+
xcodebuild:
13+
# Assumed false if omitted
14+
description: 'Whether to use xcodebuild instead of SwiftPM or not'
15+
xcodebuild-device-type:
16+
# Assumed 'Mac' if omitted
17+
description: 'The device type to compile docs for when using xcodebuild (e.g. iPhone, iPad or TV)'
18+
working-directory:
19+
description: 'Root directory of package to extract symbol graphs from'
20+
21+
runs:
22+
using: "composite"
23+
steps:
24+
- name: Extract symbol graphs (with SwiftPM)
25+
if: ${{ inputs.xcodebuild != 'true' }} # Compare to constant to treat empty input as false
26+
run: |
27+
set -eux
28+
mkdir -p symbol-graphs
29+
code build --target "$TARGET" \
30+
-Xswiftc -emit-symbol-graph \
31+
-Xswiftc -emit-symbol-graph-dir -Xswiftc symbol-graphs
32+
33+
# Locate relevant symbol graphs and copy them to the target-specific
34+
# output directory
35+
mkdir -p "$TARGET-symbol-graphs"
36+
find symbol-graphs -name "$TARGET*.symbols.json" -exec cp {} $TARGET-symbol-graphs ';'
37+
shell: bash
38+
working-directory: ${{ github.workspace }}/${{ inputs.working-directory }}
39+
env:
40+
TARGET: ${{ inputs.target }}
41+
42+
- name: Extract symbol graphs (with xcodebuild)
43+
if: ${{ inputs.xcodebuild == 'true' }} # Compare to constant to treat empty input as false
44+
run: |
45+
set -ex
46+
destination=""
47+
if [[ $DEVICE_TYPE == "Mac" ]] || [[ $DEVICE_TYPE == "" ]]; then
48+
destination="platform=OS X"
49+
else
50+
destination="id=$(xcrun simctl list devices $devicetype available | grep -v -- -- | tail -n 1 | grep -oE '[0-9A-F\-]{36}')"
51+
fi
52+
53+
# I've found that the most reliable way to produce symbol graphs with
54+
# xcodebuild is to just ask it to do a documentation build. This takes
55+
# longer than just emitting symbol graphs while building cause it compiles
56+
# the documentation as well, but I haven't figured out how to get it to do
57+
# so.
58+
xcodebuild -skipMacroValidation -scheme "$TARGET" -destination "$destination" \
59+
-derivedDataPath /tmp/data docbuild \
60+
"OTHER_DOCC_FLAGS=--transform-for-static-hosting --hosting-base-path code-cross-ui --source-service github --source-service-base-url https://github.com/stackotter/code-cross-ui/blob/main --checkout-path ." \
61+
| xcbeautify --renderer github-actions
62+
63+
# Locate relevant symbol graphs and copy them to the target-specific
64+
# output directory
65+
mkdir -p "$TARGET-symbol-graphs"
66+
find /tmp/data -name "$TARGET*.symbols.json" -exec cp {} $TARGET-symbol-graphs ';'
67+
shell: bash
68+
working-directory: ${{ github.workspace }}/${{ inputs.working-directory }}
69+
env:
70+
TARGET: ${{ inputs.target }}
71+
DEVICE_TYPE: ${{ inputs.xcodebuild-device-type }}
72+
73+
- name: Compress symbol graphs
74+
uses: a7ul/tar-action@v1.1.0
75+
with:
76+
cwd: ${{ github.workspace }}/${{ inputs.working-directory }}
77+
command: c
78+
files: ./${{ inputs.target }}-symbol-graphs
79+
outPath: ${{ github.workspace }}/${{ inputs.target }}-symbol-graphs.tar.gz
80+
81+
- name: Upload symbol graphs
82+
uses: actions/upload-artifact@v4
83+
if: ${{ inputs.upload == 'true' }} # Compare to constant to treat empty input as false
84+
with:
85+
name: ${{ inputs.target }}-symbol-graphs.tar.gz
86+
path: ${{ inputs.target }}-symbol-graphs.tar.gz

0 commit comments

Comments
 (0)