diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2e8bcca2..fb4298ac 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -48,9 +48,6 @@ jobs: check-log-parser: runs-on: macos-latest - defaults: - run: - working-directory: Tools/LogParser steps: - uses: actions/checkout@v2 with: @@ -58,5 +55,8 @@ jobs: - 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 diff --git a/Tools/Library/LogParser/Package.swift b/Tools/Library/LogParser/Package.swift new file mode 100644 index 00000000..9fe373f3 --- /dev/null +++ b/Tools/Library/LogParser/Package.swift @@ -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"] + ) + ] +) diff --git a/Tools/Library/LogParser/README.md b/Tools/Library/LogParser/README.md new file mode 100644 index 00000000..b3883948 --- /dev/null +++ b/Tools/Library/LogParser/README.md @@ -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. diff --git a/Tools/LogParser/Sources/LogParser/ExampleAppLogFile.swift b/Tools/Library/LogParser/Sources/LogParser/ExampleAppLogFile.swift similarity index 100% rename from Tools/LogParser/Sources/LogParser/ExampleAppLogFile.swift rename to Tools/Library/LogParser/Sources/LogParser/ExampleAppLogFile.swift diff --git a/Tools/LogParser/Sources/LogParser/ExampleAppSDKLogLine.swift b/Tools/Library/LogParser/Sources/LogParser/ExampleAppSDKLogLine.swift similarity index 100% rename from Tools/LogParser/Sources/LogParser/ExampleAppSDKLogLine.swift rename to Tools/Library/LogParser/Sources/LogParser/ExampleAppSDKLogLine.swift diff --git a/Tools/LogParser/Sources/LogParser/SDKLogMessage.swift b/Tools/Library/LogParser/Sources/LogParser/SDKLogMessage.swift similarity index 100% rename from Tools/LogParser/Sources/LogParser/SDKLogMessage.swift rename to Tools/Library/LogParser/Sources/LogParser/SDKLogMessage.swift diff --git a/Tools/LogParser/Tests/LogParserTests/ExampleAppLogFileTests.swift b/Tools/Library/LogParser/Tests/LogParserTests/ExampleAppLogFileTests.swift similarity index 100% rename from Tools/LogParser/Tests/LogParserTests/ExampleAppLogFileTests.swift rename to Tools/Library/LogParser/Tests/LogParserTests/ExampleAppLogFileTests.swift diff --git a/Tools/LogParser/Tests/LogParserTests/ExampleAppSDKLogLineTests.swift b/Tools/Library/LogParser/Tests/LogParserTests/ExampleAppSDKLogLineTests.swift similarity index 100% rename from Tools/LogParser/Tests/LogParserTests/ExampleAppSDKLogLineTests.swift rename to Tools/Library/LogParser/Tests/LogParserTests/ExampleAppSDKLogLineTests.swift diff --git a/Tools/LogParser/Tests/LogParserTests/SDKLogMessageTests.swift b/Tools/Library/LogParser/Tests/LogParserTests/SDKLogMessageTests.swift similarity index 100% rename from Tools/LogParser/Tests/LogParserTests/SDKLogMessageTests.swift rename to Tools/Library/LogParser/Tests/LogParserTests/SDKLogMessageTests.swift diff --git a/Tools/LogParser/Package.resolved b/Tools/Library/LogParserExample/Package.resolved similarity index 100% rename from Tools/LogParser/Package.resolved rename to Tools/Library/LogParserExample/Package.resolved diff --git a/Tools/Library/LogParserExample/Package.swift b/Tools/Library/LogParserExample/Package.swift new file mode 100644 index 00000000..623b2329 --- /dev/null +++ b/Tools/Library/LogParserExample/Package.swift @@ -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") + ] + ), + ] +) diff --git a/Tools/Library/LogParserExample/README.md b/Tools/Library/LogParserExample/README.md new file mode 100644 index 00000000..537c71a3 --- /dev/null +++ b/Tools/Library/LogParserExample/README.md @@ -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 +``` diff --git a/Tools/LogParser/Examples/CommandLineExample/Sources/ParseLogFileCommand.swift b/Tools/Library/LogParserExample/Sources/LogParserExample/ParseLogFileCommand.swift similarity index 100% rename from Tools/LogParser/Examples/CommandLineExample/Sources/ParseLogFileCommand.swift rename to Tools/Library/LogParserExample/Sources/LogParserExample/ParseLogFileCommand.swift diff --git a/Tools/LogParser/Examples/CommandLineExample/example.txt b/Tools/Library/LogParserExample/example.txt similarity index 100% rename from Tools/LogParser/Examples/CommandLineExample/example.txt rename to Tools/Library/LogParserExample/example.txt diff --git a/Tools/LogParser/Package.swift b/Tools/LogParser/Package.swift deleted file mode 100644 index fb695eb8..00000000 --- a/Tools/LogParser/Package.swift +++ /dev/null @@ -1,39 +0,0 @@ -// 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"]), - .executable( - name: "CommandLineExample", - targets: ["CommandLineExample"]) - ], - dependencies: [ - .package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.0") - ], - targets: [ - .target( - name: "LogParser" - ), - .testTarget( - name: "LogParserTests", - dependencies: ["LogParser"] - ), - .executableTarget( - name: "CommandLineExample", - dependencies: [ - "LogParser", - .product(name: "ArgumentParser", package: "swift-argument-parser") - ], - path: "Examples/CommandLineExample/Sources" - ) - ] -) diff --git a/Tools/LogParser/README.md b/Tools/LogParser/README.md deleted file mode 100644 index 9268b6a3..00000000 --- a/Tools/LogParser/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 [`Examples/CommandLineExample`](Examples/CommandLineExample) which demonstrates how to use the library. You can run it on an example log file by running the following command from the current directory: - -```bash -swift run CommandLineExample Examples/CommandLineExample/example.txt -``` diff --git a/Tools/README.md b/Tools/README.md new file mode 100644 index 00000000..807a8b81 --- /dev/null +++ b/Tools/README.md @@ -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).