Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Consolidate project into single GraphViz module #18

Merged
merged 4 commits into from
Apr 17, 2021
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
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Changed package to consolidate everything into a single `GraphViz` module.
#18 by @mattt.

## [0.3.0] - 2021-03-29

### Changed
Expand Down
16 changes: 2 additions & 14 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,9 @@ let package = Package(
]),
.target(
name: "GraphViz",
dependencies: ["Core", "DOT", "Builder", "Tools"]),
.target(
name: "Core",
dependencies: []),
.target(
name: "DOT",
dependencies: ["Core"]),
.target(
name: "Builder",
dependencies: ["Core"]),
.target(
name: "Tools",
dependencies: ["Core", "DOT", "Clibgraphviz"]),
dependencies: ["Clibgraphviz"]),
.testTarget(
name: "GraphVizTests",
dependencies: ["Core", "DOT", "Builder", "Tools"]),
dependencies: ["GraphViz"]),
]
)
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A Swift package for working with [GraphViz][graphviz].
## Requirements

- Swift 5.2+
- GraphViz _(only for rendering)_
- GraphViz

## Usage

Expand Down Expand Up @@ -69,6 +69,18 @@ let graph = Graph(directed: true) {

## Installation

### System Dependencies

You can install GraphViz on your system by running the following command:

```terminal
# macOS
$ brew install graphviz

# Linux (Ubuntu)
$ sudo apt-get install graphviz
```

### Swift Package Manager

Add the GraphViz package to your target dependencies in `Package.swift`:
Expand Down Expand Up @@ -96,19 +108,6 @@ targets: [
dependencies: ["GraphViz"]),
```

To render graphs to SVG, PNG, and other formats,
you must have GraphViz executables (e.g. `dot`) installed on your system
and accessible from `$PATH`.
You can install GraphViz from the command line:

```terminal
# macOS
$ brew install graphviz

# Linux (Ubuntu)
$ sudo apt-get install graphviz
```

## License

MIT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

extension Edge {
public subscript<T>(dynamicMember member: WritableKeyPath<Attributes, T>) -> (T) -> Self {
get {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

extension Graph {
typealias Fragment = GraphBuilder.Fragment

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

extension Node {
public subscript<T>(dynamicMember member: WritableKeyPath<Attributes, T>) -> (T) -> Self {
get {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

extension Subgraph {
typealias Fragment = SubgraphBuilder.Fragment

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

public protocol GraphMember {}

extension Subgraph: GraphMember {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

infix operator <-- : AdditionPrecedence

extension Node {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

infix operator <-> : AdditionPrecedence

extension Node {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

infix operator --> : AdditionPrecedence

extension Node {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

infix operator --- : AdditionPrecedence

extension Node {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

public protocol SubgraphMember {}

extension Node: SubgraphMember {}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Core

/// Creates DOT language representations of GraphViz graphs.
///
/// For more information about the DOT language,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import Core

protocol DOTRepresentable {
func representation(in graph: Graph) -> String?
Expand Down
4 changes: 0 additions & 4 deletions Sources/GraphViz/Graphviz.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Foundation
import Dispatch

import Core

extension Graph {
/**
Renders the graph using the specified layout algorithm to the desired output format.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Foundation
import Dispatch

import Core
import DOT
import Clibgraphviz

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/GraphVizTests/AttributesTest.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import XCTest
@testable import Core
@testable import GraphViz

final class AttributesTests: XCTestCase {
func testGraphAttributesCompleteness() {
Expand Down
3 changes: 1 addition & 2 deletions Tests/GraphVizTests/EdgeTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import XCTest
import Core
@testable import DOT
@testable import GraphViz

final class EdgeTests: XCTestCase {
let encoder = DOTEncoder()
Expand Down
4 changes: 1 addition & 3 deletions Tests/GraphVizTests/GraphBuilderTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import XCTest
import Core
import DOT
@testable import Builder
@testable import GraphViz

// Workaround for "error: ambiguous reference to member '-->'" on Swift 5.1
#if swift(>=5.2)
Expand Down
3 changes: 1 addition & 2 deletions Tests/GraphVizTests/GraphTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import XCTest
import Core
import DOT
@testable import GraphViz

final class GraphTests: XCTestCase {
let encoder = DOTEncoder()
Expand Down
3 changes: 1 addition & 2 deletions Tests/GraphVizTests/NodeTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import XCTest
import Core
@testable import DOT
@testable import GraphViz

final class NodeTests: XCTestCase {
let encoder = DOTEncoder()
Expand Down
4 changes: 1 addition & 3 deletions Tests/GraphVizTests/RenderingTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import XCTest
@testable import Core
@testable import DOT
@testable import Tools
@testable import GraphViz

final class RenderingTests: XCTestCase {
let encoder = DOTEncoder()
Expand Down
4 changes: 1 addition & 3 deletions Tests/GraphVizTests/SubgraphBuilderTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import XCTest
import Core
@testable import DOT
@testable import Builder
@testable import GraphViz

// Workaround for "error: ambiguous reference to member '-->'" on Swift 5.1
#if swift(>=5.2)
Expand Down
3 changes: 1 addition & 2 deletions Tests/GraphVizTests/SubgraphTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import XCTest
import Core
@testable import DOT
@testable import GraphViz

final class SubgraphTests: XCTestCase {
let encoder = DOTEncoder()
Expand Down