ADAR analyses Swift projects and visualises their architecture as an interactive 3D graph in augmented reality. This repository is the canonical source release.
The project is source-available under CC BY-NC-SA 4.0. Commercial use is not permitted. The iOS viewer source is included; signed app binaries are distributed privately.
Add the package to a Swift package or Xcode project:
.package(url: "https://github.com/gf0x/ADAR.git", from: "0.1.0")Available source-built products:
| Product | Purpose |
|---|---|
ADAR2LintPlugin |
Build-tool plugin that emits diagnostics from an existing .adar model |
GenerateADARModel |
Command plugin that generates .adar models |
adar2-lint |
Standalone diagnostics executable |
ADAR2ModelBuilder |
Standalone analyzer and model-generation executable |
Enable linting for a target:
.target(
name: "MyTarget",
plugins: [.plugin(name: "ADAR2LintPlugin", package: "ADAR")]
)Generate a model from a package checkout:
swift package generate-adar-model| Package | Purpose |
|---|---|
ADAR2Shared |
Codable graph and bug-report models |
ADAR2Core |
Graph implementations and force-directed simulation |
ADAR2SwiftAnalyzer |
Symbol graph and SwiftSyntax analysis |
ADAR2BugDetector |
Structural anomaly detection |
ADAR2NaiveForceDirectedVisualizer |
All-pairs force-directed layout |
ADAR2AdvancedForceDirectedVisualizer |
Barnes-Hut octree layout |
ADAR2MLVisualizer |
CoreML-assisted layout |
ADAR2ModelBuilder |
Model-generation CLI |
ADAR2LintPlugin |
SwiftPM integration and linter |
ADAR2 |
iOS ARKit and SceneKit viewer |
The linter reads .adarconfig from the project root:
{
"rules": {
"high_degree_node": "warning",
"low_cohesion_edge": "warning",
"cycle_edge": "error",
"edge_crossing": "ignore"
}
}Supported severities are warning, error, and ignore. Source annotations can suppress findings:
// adar_disable:next cycle_edge
final class IntentionalCycle {}Run package tests:
for package in ADAR2Shared ADAR2Core ADAR2BugDetector \
ADAR2AdvancedForceDirectedVisualizer ADAR2NaiveForceDirectedVisualizer \
ADAR2MLVisualizer ADAR2SwiftAnalyzer; do
swift test --package-path "$package"
done
swift buildBuild the unsigned iOS simulator app:
xcodebuild -workspace ADAR2.xcworkspace -scheme ADAR2 \
-sdk iphonesimulator CODE_SIGNING_ALLOWED=NO buildSee NOTICE.md for bundled asset provenance and CONTRIBUTING.md before submitting changes.