Skip to content

Commit

Permalink
Merge pull request #515 from ably/move-LogParser-example-app
Browse files Browse the repository at this point in the history
Move the LogParser example app outside of the library’s directory
  • Loading branch information
lawrence-forooghian authored Dec 16, 2022
2 parents 86b3a9f + d53216a commit 8c9b143
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 53 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ jobs:

check-log-parser:
runs-on: macos-latest
defaults:
run:
working-directory: Tools/LogParser
steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Run LogParser tests
run: swift test
- name: Build LogParser command-line example app
run: swift build --target CommandLineExample
working-directory: Tools/Library/LogParser

- name: Build LogParserExample app
run: swift build
working-directory: Tools/Library/LogParserExample
25 changes: 25 additions & 0 deletions Tools/Library/LogParser/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "LogParser",
platforms: [
.macOS(.v12)
],
products: [
.library(
name: "LogParser",
targets: ["LogParser"])
],
targets: [
.target(
name: "LogParser"
),
.testTarget(
name: "LogParserTests",
dependencies: ["LogParser"]
)
]
)
5 changes: 5 additions & 0 deletions Tools/Library/LogParser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# LogParser

A package for parsing the log output of the Ably Asset Tracking Swift SDKs and their example apps.

There is an example command-line app in [`../LogParserExample`](../LogParserExample) which demonstrates how to use the library.
File renamed without changes.
24 changes: 24 additions & 0 deletions Tools/Library/LogParserExample/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "LogParserExample",
platforms: [
.macOS(.v12)
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.0"),
.package(path: "../LogParser")
],
targets: [
.executableTarget(
name: "LogParserExample",
dependencies: [
.product(name: "LogParser", package: "LogParser"),
.product(name: "ArgumentParser", package: "swift-argument-parser")
]
),
]
)
9 changes: 9 additions & 0 deletions Tools/Library/LogParserExample/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# LogParserExample

An example command-line app which demonstrates how to use the [LogParser library](../LogParser).

You can run it on an example log file by running the following command from the current directory:

```bash
swift run LogParserExample example.txt
```
File renamed without changes.
39 changes: 0 additions & 39 deletions Tools/LogParser/Package.swift

This file was deleted.

9 changes: 0 additions & 9 deletions Tools/LogParser/README.md

This file was deleted.

5 changes: 5 additions & 0 deletions Tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Developer tools for the Ably Asset Tracking Swift SDKs

This directory contains tooling intended to be used by developers working on the Ably Asset Tracking Swift SDKs.

It currently just contains the [`Library`](Library) directory, which contains the [`LogParser` library](Library/LogParser) for parsing logs emitted by these SDKs, as well as [an example app for the `LogParser` library](Library/LogParserExample).

0 comments on commit 8c9b143

Please sign in to comment.