diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 96008a27..5e97c4e4 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -7,12 +7,12 @@ on: jobs: build: name: Generate DocC - runs-on: macos-15 + runs-on: macos-26 steps: - uses: actions/checkout@v3 - - name: Select Xcode 16.4 - run: sudo xcode-select -s /Applications/Xcode_16.4.app + - name: Select Xcode 26.3 + run: sudo xcode-select -s /Applications/Xcode_26.3.app - name: Build DocC run: | @@ -30,7 +30,7 @@ jobs: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: macos-15 + runs-on: ubuntu-latest steps: - name: Deploy to GitHub Pages id: deployment diff --git a/Sources/MachOArchiveKit/Util/exported.swift b/Sources/MachOArchiveKit/Util/exported.swift index 75fb4fdc..b06199c2 100644 --- a/Sources/MachOArchiveKit/Util/exported.swift +++ b/Sources/MachOArchiveKit/Util/exported.swift @@ -3,8 +3,13 @@ // MachOKit // // Created by p-x9 on 2026/03/17 -// // +// + +@_documentation(visibility: internal) +@_exported +import MachOKit -@_exported import MachOKit -@_exported import ObjectArchiveKit +@_documentation(visibility: internal) +@_exported +import ObjectArchiveKit diff --git a/MachOKit.docc/MachOKit.md b/Sources/MachOKit/Documentation.docc/MachOKit.md similarity index 55% rename from MachOKit.docc/MachOKit.md rename to Sources/MachOKit/Documentation.docc/MachOKit.md index 223e1f49..9dd2e813 100644 --- a/MachOKit.docc/MachOKit.md +++ b/Sources/MachOKit/Documentation.docc/MachOKit.md @@ -1,3 +1,6 @@ # ``MachOKit`` 🔬 A Swift library for parsing MachO files to obtain various information. + +> Note: +> Unix archive (.a) format is supported by ``MachOArchiveKit``. diff --git a/MachOKit.docc/MachOKitC.md b/Sources/MachOKit/Documentation.docc/MachOKitC.md similarity index 100% rename from MachOKit.docc/MachOKitC.md rename to Sources/MachOKit/Documentation.docc/MachOKitC.md diff --git a/Sources/MachOKitC/include/core_foundation.h b/Sources/MachOKitC/include/core_foundation.h index 65bf07b5..91445411 100644 --- a/Sources/MachOKitC/include/core_foundation.h +++ b/Sources/MachOKitC/include/core_foundation.h @@ -3,12 +3,14 @@ // MachOKit // // Created by p-x9 on 2025/02/01 -// +// // #ifndef core_foundation_h #define core_foundation_h +#include + // ref: https://github.com/apple-oss-distributions/CF/blob/dc54c6bb1c1e5e0b9486c1d26dd5bef110b20bf3/CFRuntime.h#L222-L228 typedef struct __CFRuntimeBase64 { uint64_t _cfisa; diff --git a/scripts/docc-preview.sh b/scripts/docc-preview.sh index 943cee08..7effd189 100644 --- a/scripts/docc-preview.sh +++ b/scripts/docc-preview.sh @@ -6,7 +6,7 @@ preview_docc() { mkdir -p docs $(xcrun --find docc) preview \ - "./${TARGET}.docc" \ + "./Sources/${TARGET}/Documentation.docc" \ --additional-symbol-graph-dir symbol-graphs \ --output-path "docs" } diff --git a/scripts/docc.sh b/scripts/docc.sh index e579c88a..f973b421 100644 --- a/scripts/docc.sh +++ b/scripts/docc.sh @@ -7,7 +7,7 @@ generate_docc() { mkdir -p docs $(xcrun --find docc) convert \ - "./${TARGET}.docc" \ + "./Sources/${TARGET}/Documentation.docc" \ --output-path "docs" \ --hosting-base-path "${REPO_NAME}" \ --additional-symbol-graph-dir ./symbol-graphs diff --git a/scripts/generate-symbols.sh b/scripts/generate-symbols.sh index 3b1f932a..685d80d8 100644 --- a/scripts/generate-symbols.sh +++ b/scripts/generate-symbols.sh @@ -28,10 +28,18 @@ generate_symbol_graphs() { xcodebuild clean build -scheme "${scheme}"\ -destination "generic/platform=${destination}" \ - OTHER_SWIFT_FLAGS="-emit-extension-block-symbols -emit-symbol-graph -emit-symbol-graph-dir $(pwd)/.build/symbol-graphs" + OTHER_SWIFT_FLAGS="-emit-extension-block-symbols -emit-symbol-graph -emit-symbol-graph-dir $(pwd)/.build/symbol-graphs" \ + DOCC_EXTRACT_EXTENSION_SYMBOLS=YES mv "./.build/symbol-graphs/${scheme}.symbols.json" "${SYMBOL_DIR}/${scheme}_${destination}.symbols.json" + # Extension + for file in ./.build/symbol-graphs/${scheme}@*.symbols.json; do + if [ -f "$file" ]; then + mv "$file" "${SYMBOL_DIR}/$(basename "${file%.symbols.json}").symbols.json" + fi + done + if [ -d "./Sources/$scheme/include" ]; then local HEADERS=$(ls "./Sources/$scheme/include") while IFS= read -r header; do @@ -48,8 +56,10 @@ generate_symbol_graphs() { clean_build clean_xcbuild ios MachOKitC clean_xcbuild ios MachOKit +clean_xcbuild ios MachOArchiveKit clean_symbol generate_symbol_graphs ios MachOKitC generate_symbol_graphs ios MachOKit +generate_symbol_graphs ios MachOArchiveKit