Skip to content

Commit 3093a3f

Browse files
authored
Merge pull request #268 from p-x9/feature/macho-archive-docc
2 parents 25e56cb + 5c55eb2 commit 3093a3f

File tree

7 files changed

+27
-7
lines changed

7 files changed

+27
-7
lines changed

Sources/MachOArchiveKit/Util/exported.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
// MachOKit
44
//
55
// Created by p-x9 on 2026/03/17
6-
//
76
//
7+
//
8+
9+
@_documentation(visibility: internal)
10+
@_exported
11+
import MachOKit
812

9-
@_exported import MachOKit
10-
@_exported import ObjectArchiveKit
13+
@_documentation(visibility: internal)
14+
@_exported
15+
import ObjectArchiveKit

MachOKit.docc/MachOKit.md renamed to Sources/MachOKit/Documentation.docc/MachOKit.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# ``MachOKit``
22

33
🔬 A Swift library for parsing MachO files to obtain various information.
4+
5+
> [!NOTE]
6+
> Unix archive (.a) format is supported by ``MachOArchiveKit``.

MachOKit.docc/MachOKitC.md renamed to Sources/MachOKit/Documentation.docc/MachOKitC.md

File renamed without changes.

Sources/MachOKitC/include/core_foundation.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
// MachOKit
44
//
55
// Created by p-x9 on 2025/02/01
6-
//
6+
//
77
//
88

99
#ifndef core_foundation_h
1010
#define core_foundation_h
1111

12+
#include <stdint.h>
13+
1214
// ref: https://github.com/apple-oss-distributions/CF/blob/dc54c6bb1c1e5e0b9486c1d26dd5bef110b20bf3/CFRuntime.h#L222-L228
1315
typedef struct __CFRuntimeBase64 {
1416
uint64_t _cfisa;

scripts/docc-preview.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ preview_docc() {
66
mkdir -p docs
77

88
$(xcrun --find docc) preview \
9-
"./${TARGET}.docc" \
9+
"./Sources/${TARGET}/Documentation.docc" \
1010
--additional-symbol-graph-dir symbol-graphs \
1111
--output-path "docs"
1212
}

scripts/docc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ generate_docc() {
77
mkdir -p docs
88

99
$(xcrun --find docc) convert \
10-
"./${TARGET}.docc" \
10+
"./Sources/${TARGET}/Documentation.docc" \
1111
--output-path "docs" \
1212
--hosting-base-path "${REPO_NAME}" \
1313
--additional-symbol-graph-dir ./symbol-graphs

scripts/generate-symbols.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,18 @@ generate_symbol_graphs() {
2828

2929
xcodebuild clean build -scheme "${scheme}"\
3030
-destination "generic/platform=${destination}" \
31-
OTHER_SWIFT_FLAGS="-emit-extension-block-symbols -emit-symbol-graph -emit-symbol-graph-dir $(pwd)/.build/symbol-graphs"
31+
OTHER_SWIFT_FLAGS="-emit-extension-block-symbols -emit-symbol-graph -emit-symbol-graph-dir $(pwd)/.build/symbol-graphs" \
32+
DOCC_EXTRACT_EXTENSION_SYMBOLS=YES
3233

3334
mv "./.build/symbol-graphs/${scheme}.symbols.json" "${SYMBOL_DIR}/${scheme}_${destination}.symbols.json"
3435

36+
# Extension
37+
for file in ./.build/symbol-graphs/${scheme}@*.symbols.json; do
38+
if [ -f "$file" ]; then
39+
mv "$file" "${SYMBOL_DIR}/$(basename "${file%.symbols.json}").symbols.json"
40+
fi
41+
done
42+
3543
if [ -d "./Sources/$scheme/include" ]; then
3644
local HEADERS=$(ls "./Sources/$scheme/include")
3745
while IFS= read -r header; do
@@ -48,8 +56,10 @@ generate_symbol_graphs() {
4856
clean_build
4957
clean_xcbuild ios MachOKitC
5058
clean_xcbuild ios MachOKit
59+
clean_xcbuild ios MachOArchiveKit
5160

5261
clean_symbol
5362

5463
generate_symbol_graphs ios MachOKitC
5564
generate_symbol_graphs ios MachOKit
65+
generate_symbol_graphs ios MachOArchiveKit

0 commit comments

Comments
 (0)