Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions AGENT.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add the Claude.md symlink? Otherwise, AGENT.md by itself doesn't do anything, does it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I added the symlink.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Architecture

XcodeGraph is a Swift Package containing data structures and utilities for modeling Xcode project graphs. It consists of three main modules:

- **XcodeGraph**: Core data structures (Graph, Target, Project, Workspace, etc.) for modeling Xcode projects
- **XcodeMetadata**: Metadata extraction from precompiled binaries (frameworks, libraries, XCFrameworks)
- **XcodeGraphMapper**: Maps actual `.xcworkspace`/`.xcodeproj` files to XcodeGraph structures using XcodeProj

### Key Components

- `Sources/XcodeGraph/Models/`: Core data structures like Project, Target, Scheme, BuildConfiguration
- `Sources/XcodeGraph/Graph/`: Graph representation with dependencies and relationships
- `Sources/XcodeGraphMapper/Mappers/`: Conversion logic from XcodeProj to XcodeGraph models
- `Sources/XcodeMetadata/Providers/`: Binary metadata extraction for frameworks and libraries

## Development Commands

### Building
```bash
swift build # Debug build
swift build --configuration release # Release build
```

### Testing
```bash
swift test # Run all tests
swift test --skip XcodeGraphMapperTests --skip XcodeMetadataTests # Linux (no Xcode utilities)
```

### Linting
```bash
mise run lint # Run SwiftLint and SwiftFormat
mise run lint-fix # Auto-fix linting issues
```

### Documentation
```bash
mise run docs:build # Build documentation
```

## Platform Support

- Requires macOS 13+ for full functionality
- Linux support available with limited testing (XcodeGraphMapperTests and XcodeMetadataTests require Xcode utilities)
- Swift 6.0.3+ with StrictConcurrency enabled

## Testing Strategy

- Unit tests for each module in corresponding `Tests/` directories
- Test data and mocks in `Tests/*/TestData/` and `Tests/*/Mocks/`
- XCFramework fixtures in `Tests/Fixtures/` for metadata testing
55 changes: 0 additions & 55 deletions CLAUDE.md

This file was deleted.

1 change: 1 addition & 0 deletions CLAUDE.md
18 changes: 9 additions & 9 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Sources/XcodeGraph/PackageInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ extension PackageInfo.Target {
case unsafeFlags
case enableUpcomingFeature
case enableExperimentalFeature
case interoperabilityMode
}

/// An individual build setting.
Expand Down Expand Up @@ -497,6 +498,7 @@ extension PackageInfo.Target {
case unsafeFlags([String])
case enableUpcomingFeature(String)
case enableExperimentalFeature(String)
case interoperabilityMode(String)
}

public init(from decoder: Decoder) throws {
Expand All @@ -506,6 +508,9 @@ extension PackageInfo.Target {
condition = try container.decodeIfPresent(PackageInfo.PackageConditionDescription.self, forKey: .condition)
if let kind = try? container.decode(Kind.self, forKey: .kind) {
switch kind {
case let .interoperabilityMode(mode):
name = .interoperabilityMode
value = [mode]
case let .headerSearchPath(value):
name = .headerSearchPath
self.value = [value]
Expand Down Expand Up @@ -543,6 +548,8 @@ extension PackageInfo.Target {
try container.encode(tool, forKey: .tool)
try container.encodeIfPresent(condition, forKey: .condition)
switch name {
case .interoperabilityMode:
try container.encode(Kind.interoperabilityMode(value.first!), forKey: .kind)
case .headerSearchPath:
try container.encode(Kind.headerSearchPath(value.first!), forKey: .kind)
case .define:
Expand Down