From 46e50b6dbc6e6b249cbb772684d6b7ae579c092b Mon Sep 17 00:00:00 2001 From: Matt <85322+mattmassicotte@users.noreply.github.com> Date: Sat, 14 Oct 2023 08:01:17 -0400 Subject: [PATCH] Basic structure --- .github/workflows/ci.yml | 2 +- .gitignore | 8 +++++ Package.resolved | 50 +++++++++++++++++++++++++++++ Package.swift | 33 +++++++++++++++++++ Sources/XCLinting/File.swift | 2 ++ Sources/clitool/main.swift | 4 +++ Tests/XCLintTests/XCLintTests.swift | 7 ++++ 7 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 Package.resolved create mode 100644 Package.swift create mode 100644 Sources/XCLinting/File.swift create mode 100644 Sources/clitool/main.swift create mode 100644 Tests/XCLintTests/XCLintTests.swift diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2effbda..a3d5e1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - name: Install XCBeautify run: brew install xcbeautify - name: Test platform ${{ matrix.destination }} - run: set -o pipefail && xcodebuild -scheme xclint -destination "${{ matrix.destination }}" test | xcbeautify --renderer github-actions + run: set -o pipefail && xcodebuild -scheme XCLint-Package -destination "${{ matrix.destination }}" test | xcbeautify --renderer github-actions linux_test: name: Test Linux diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0023a53 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +/.build +/Packages +xcuserdata/ +DerivedData/ +.swiftpm/configuration/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..f9faee7 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,50 @@ +{ + "pins" : [ + { + "identity" : "aexml", + "kind" : "remoteSourceControl", + "location" : "https://github.com/tadija/AEXML.git", + "state" : { + "revision" : "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", + "version" : "4.6.1" + } + }, + { + "identity" : "pathkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kylef/PathKit.git", + "state" : { + "revision" : "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", + "version" : "1.0.1" + } + }, + { + "identity" : "spectre", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kylef/Spectre.git", + "state" : { + "revision" : "26cc5e9ae0947092c7139ef7ba612e34646086c7", + "version" : "0.10.1" + } + }, + { + "identity" : "xcconfig", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattmassicotte/XCConfig", + "state" : { + "branch" : "main", + "revision" : "26059718eab7a4fa723dd75cde45cf099d3e75a8" + } + }, + { + "identity" : "xcodeproj", + "kind" : "remoteSourceControl", + "location" : "https://github.com/tuist/XcodeProj", + "state" : { + "revision" : "3797181813ee963fe305d939232bc576d23ddbb0", + "version" : "8.15.0" + } + } + ], + "version" : 2 +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..c1f2f91 --- /dev/null +++ b/Package.swift @@ -0,0 +1,33 @@ +// swift-tools-version: 5.9 + +import PackageDescription + +let package = Package( + name: "XCLint", + platforms: [.macOS(.v13)], + products: [ + .executable(name: "xclint", targets: ["clitool"]), + // I'd prefer to name this "XCLint", but it seems like Xcode cannot handle two products with the same name, even if they differ in case + .library(name: "XCLinting", targets: ["XCLinting"]), + ], + dependencies: [ + .package(url: "https://github.com/tuist/XcodeProj", from: "8.15.0"), + .package(url: "https://github.com/mattmassicotte/XCConfig", branch: "main"), + ], + targets: [ + .executableTarget(name: "clitool", dependencies: ["XCLinting"]), + .target(name: "XCLinting", dependencies: ["XCConfig", "XcodeProj"]), + .testTarget(name: "XCLintTests", dependencies: ["XCLinting"]), + + ] +) + +let swiftSettings: [SwiftSetting] = [ + .enableExperimentalFeature("StrictConcurrency") +] + +for target in package.targets { + var settings = target.swiftSettings ?? [] + settings.append(contentsOf: swiftSettings) + target.swiftSettings = settings +} diff --git a/Sources/XCLinting/File.swift b/Sources/XCLinting/File.swift new file mode 100644 index 0000000..9573382 --- /dev/null +++ b/Sources/XCLinting/File.swift @@ -0,0 +1,2 @@ +public struct XCLintThing { +} diff --git a/Sources/clitool/main.swift b/Sources/clitool/main.swift new file mode 100644 index 0000000..44e20d5 --- /dev/null +++ b/Sources/clitool/main.swift @@ -0,0 +1,4 @@ +// The Swift Programming Language +// https://docs.swift.org/swift-book + +print("Hello, world!") diff --git a/Tests/XCLintTests/XCLintTests.swift b/Tests/XCLintTests/XCLintTests.swift new file mode 100644 index 0000000..f2112ad --- /dev/null +++ b/Tests/XCLintTests/XCLintTests.swift @@ -0,0 +1,7 @@ +import XCTest +import XCLint + +final class XCLintTests: XCTestCase { + func testExample() throws { + } +}