From 846be6026c704ce80a02f16291d9a3f6acbe09f5 Mon Sep 17 00:00:00 2001 From: Jota Uribe Date: Fri, 17 Jul 2020 19:06:38 -0500 Subject: [PATCH] Added swift package manager support --- .gitignore | 16 +- .swiftlint.yml | 4 +- .../contents.xcworkspacedata | 0 .../xcshareddata/xcschemes/Chroma.xcscheme | 53 +-- Chroma.xcodeproj/project.pbxproj | 373 ------------------ .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcshareddata/swiftpm/Package.resolved | 25 -- .../xcschemes/xcschememanagement.plist | 22 -- Package.swift | 34 ++ README.md | 3 + {Application => Sources/Chroma}/File.swift | 0 {Application => Sources/Chroma}/Folder.swift | 0 .../Chroma}/Generator.swift | 0 {Application => Sources/Chroma}/Output.swift | 0 .../Chroma}/Platform.swift | 0 {Application => Sources/Chroma}/main.swift | 0 Tests/ChromaTests/ChromaTests.swift | 15 + Tests/ChromaTests/XCTestManifests.swift | 9 + Tests/LinuxMain.swift | 7 + 19 files changed, 115 insertions(+), 454 deletions(-) rename {Chroma.xcodeproj/project.xcworkspace => .swiftpm/xcode/package.xcworkspace}/contents.xcworkspacedata (100%) rename {Chroma.xcodeproj => .swiftpm/xcode}/xcshareddata/xcschemes/Chroma.xcscheme (63%) delete mode 100644 Chroma.xcodeproj/project.pbxproj delete mode 100644 Chroma.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 Chroma.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved delete mode 100644 Chroma.xcodeproj/xcuserdata/jjotaum.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Package.swift create mode 100644 README.md rename {Application => Sources/Chroma}/File.swift (100%) rename {Application => Sources/Chroma}/Folder.swift (100%) rename {Application => Sources/Chroma}/Generator.swift (100%) rename {Application => Sources/Chroma}/Output.swift (100%) rename {Application => Sources/Chroma}/Platform.swift (100%) rename {Application => Sources/Chroma}/main.swift (100%) create mode 100644 Tests/ChromaTests/ChromaTests.swift create mode 100644 Tests/ChromaTests/XCTestManifests.swift create mode 100644 Tests/LinuxMain.swift diff --git a/.gitignore b/.gitignore index 56833f3..2e320e4 100755 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,18 @@ UserInterfaceState.xcuserstate # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # -# Pods/ \ No newline at end of file +# Pods/ + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +Packages/ +Package.pins +Package.resolved +*.xcodeproj + +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ \ No newline at end of file diff --git a/.swiftlint.yml b/.swiftlint.yml index 4a17463..13573a6 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,7 +1,7 @@ disabled_rules: # rule identifiers to exclude from running - trailing_whitespace included: - - Application + - Sources excluded: # paths to ignore during linting. Takes precedence over `included`. - Build - \ No newline at end of file + diff --git a/Chroma.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Chroma.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/Chroma.xcodeproj/xcshareddata/xcschemes/Chroma.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Chroma.xcscheme similarity index 63% rename from Chroma.xcodeproj/xcshareddata/xcschemes/Chroma.xcscheme rename to .swiftpm/xcode/xcshareddata/xcschemes/Chroma.xcscheme index f6aeb1b..de2e1d8 100644 --- a/Chroma.xcodeproj/xcshareddata/xcschemes/Chroma.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/Chroma.xcscheme @@ -14,10 +14,24 @@ buildForAnalyzing = "YES"> + ReferencedContainer = "container:"> + + + + @@ -28,6 +42,16 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + - - - - - - - - - + + ReferencedContainer = "container:"> - + diff --git a/Chroma.xcodeproj/project.pbxproj b/Chroma.xcodeproj/project.pbxproj deleted file mode 100644 index 6307542..0000000 --- a/Chroma.xcodeproj/project.pbxproj +++ /dev/null @@ -1,373 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 52; - objects = { - -/* Begin PBXBuildFile section */ - 5E0FAA70248DC3F200B57DC1 /* Platform.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E0FAA6F248DC3F200B57DC1 /* Platform.swift */; }; - 5E0FAA72248DC5A800B57DC1 /* Folder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E0FAA71248DC5A800B57DC1 /* Folder.swift */; }; - 5E0FAA75248DC92800B57DC1 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E0FAA74248DC92800B57DC1 /* File.swift */; }; - B221DAE0248D901200BE201A /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = B221DADF248D901200BE201A /* main.swift */; }; - B221DAE8248D905700BE201A /* Files in Frameworks */ = {isa = PBXBuildFile; productRef = B221DAE7248D905700BE201A /* Files */; }; - B221DAEB248D90A900BE201A /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = B221DAEA248D90A900BE201A /* ArgumentParser */; }; - B221DAED248D90D700BE201A /* Generator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B221DAEC248D90D700BE201A /* Generator.swift */; }; - B2E7DD3E248F274400F5F211 /* Output.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2E7DD3D248F274400F5F211 /* Output.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - B221DADA248D901200BE201A /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 5E0FAA6F248DC3F200B57DC1 /* Platform.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Platform.swift; sourceTree = ""; }; - 5E0FAA71248DC5A800B57DC1 /* Folder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Folder.swift; sourceTree = ""; }; - 5E0FAA74248DC92800B57DC1 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; - B221DADC248D901200BE201A /* Chroma */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Chroma; sourceTree = BUILT_PRODUCTS_DIR; }; - B221DADF248D901200BE201A /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; - B221DAEC248D90D700BE201A /* Generator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Generator.swift; sourceTree = ""; }; - B2E7DD3D248F274400F5F211 /* Output.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Output.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - B221DAD9248D901200BE201A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - B221DAEB248D90A900BE201A /* ArgumentParser in Frameworks */, - B221DAE8248D905700BE201A /* Files in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - B221DAD3248D901200BE201A = { - isa = PBXGroup; - children = ( - B221DADE248D901200BE201A /* Application */, - B221DADD248D901200BE201A /* Products */, - ); - sourceTree = ""; - }; - B221DADD248D901200BE201A /* Products */ = { - isa = PBXGroup; - children = ( - B221DADC248D901200BE201A /* Chroma */, - ); - name = Products; - sourceTree = ""; - }; - B221DADE248D901200BE201A /* Application */ = { - isa = PBXGroup; - children = ( - B221DADF248D901200BE201A /* main.swift */, - B221DAEC248D90D700BE201A /* Generator.swift */, - 5E0FAA6F248DC3F200B57DC1 /* Platform.swift */, - 5E0FAA71248DC5A800B57DC1 /* Folder.swift */, - 5E0FAA74248DC92800B57DC1 /* File.swift */, - B2E7DD3D248F274400F5F211 /* Output.swift */, - ); - path = Application; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - B221DADB248D901200BE201A /* Chroma */ = { - isa = PBXNativeTarget; - buildConfigurationList = B221DAE3248D901200BE201A /* Build configuration list for PBXNativeTarget "Chroma" */; - buildPhases = ( - B221DAD8248D901200BE201A /* Sources */, - B221DAD9248D901200BE201A /* Frameworks */, - B221DADA248D901200BE201A /* CopyFiles */, - 5E0FAA6B248DC10900B57DC1 /* SwiftLint */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Chroma; - packageProductDependencies = ( - B221DAE7248D905700BE201A /* Files */, - B221DAEA248D90A900BE201A /* ArgumentParser */, - ); - productName = Chroma; - productReference = B221DADC248D901200BE201A /* Chroma */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - B221DAD4248D901200BE201A /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 1150; - LastUpgradeCheck = 1150; - ORGANIZATIONNAME = "Jota Uribe"; - TargetAttributes = { - B221DADB248D901200BE201A = { - CreatedOnToolsVersion = 11.5; - }; - }; - }; - buildConfigurationList = B221DAD7248D901200BE201A /* Build configuration list for PBXProject "Chroma" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = B221DAD3248D901200BE201A; - packageReferences = ( - B221DAE6248D905700BE201A /* XCRemoteSwiftPackageReference "Files" */, - B221DAE9248D90A900BE201A /* XCRemoteSwiftPackageReference "swift-argument-parser" */, - ); - productRefGroup = B221DADD248D901200BE201A /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - B221DADB248D901200BE201A /* Chroma */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXShellScriptBuildPhase section */ - 5E0FAA6B248DC10900B57DC1 /* SwiftLint */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = SwiftLint; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - B221DAD8248D901200BE201A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B2E7DD3E248F274400F5F211 /* Output.swift in Sources */, - 5E0FAA75248DC92800B57DC1 /* File.swift in Sources */, - 5E0FAA70248DC3F200B57DC1 /* Platform.swift in Sources */, - B221DAE0248D901200BE201A /* main.swift in Sources */, - B221DAED248D90D700BE201A /* Generator.swift in Sources */, - 5E0FAA72248DC5A800B57DC1 /* Folder.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - B221DAE1248D901200BE201A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - B221DAE2248D901200BE201A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Release; - }; - B221DAE4248D901200BE201A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - ENABLE_HARDENED_RUNTIME = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - B221DAE5248D901200BE201A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - ENABLE_HARDENED_RUNTIME = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B221DAD7248D901200BE201A /* Build configuration list for PBXProject "Chroma" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B221DAE1248D901200BE201A /* Debug */, - B221DAE2248D901200BE201A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B221DAE3248D901200BE201A /* Build configuration list for PBXNativeTarget "Chroma" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B221DAE4248D901200BE201A /* Debug */, - B221DAE5248D901200BE201A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - -/* Begin XCRemoteSwiftPackageReference section */ - B221DAE6248D905700BE201A /* XCRemoteSwiftPackageReference "Files" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/JohnSundell/Files"; - requirement = { - kind = upToNextMinorVersion; - minimumVersion = 4.1.1; - }; - }; - B221DAE9248D90A900BE201A /* XCRemoteSwiftPackageReference "swift-argument-parser" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/apple/swift-argument-parser"; - requirement = { - kind = upToNextMinorVersion; - minimumVersion = 0.1.0; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - B221DAE7248D905700BE201A /* Files */ = { - isa = XCSwiftPackageProductDependency; - package = B221DAE6248D905700BE201A /* XCRemoteSwiftPackageReference "Files" */; - productName = Files; - }; - B221DAEA248D90A900BE201A /* ArgumentParser */ = { - isa = XCSwiftPackageProductDependency; - package = B221DAE9248D90A900BE201A /* XCRemoteSwiftPackageReference "swift-argument-parser" */; - productName = ArgumentParser; - }; -/* End XCSwiftPackageProductDependency section */ - }; - rootObject = B221DAD4248D901200BE201A /* Project object */; -} diff --git a/Chroma.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Chroma.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/Chroma.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Chroma.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Chroma.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 2c8c2e6..0000000 --- a/Chroma.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,25 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Files", - "repositoryURL": "https://github.com/JohnSundell/Files", - "state": { - "branch": null, - "revision": "22fe84797d499ffca911ccd896b34efaf06a50b9", - "version": "4.1.1" - } - }, - { - "package": "swift-argument-parser", - "repositoryURL": "https://github.com/apple/swift-argument-parser", - "state": { - "branch": null, - "revision": "3d79b2b5a2e5af52c14e462044702ea7728f5770", - "version": "0.1.0" - } - } - ] - }, - "version": 1 -} diff --git a/Chroma.xcodeproj/xcuserdata/jjotaum.xcuserdatad/xcschemes/xcschememanagement.plist b/Chroma.xcodeproj/xcuserdata/jjotaum.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 0bb235d..0000000 --- a/Chroma.xcodeproj/xcuserdata/jjotaum.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - Chroma.xcscheme_^#shared#^_ - - orderHint - 0 - - - SuppressBuildableAutocreation - - B221DADB248D901200BE201A - - primary - - - - - diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..69a6272 --- /dev/null +++ b/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.2 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "Chroma", + platforms: [ + .macOS(.v10_15) + ], + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .executable(name: "Chroma", targets: ["Chroma"]) + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + .package(url: "https://github.com/apple/swift-argument-parser", .exact("0.1.0")), + .package(url: "https://github.com/JohnSundell/Files", from: "4.1.1") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "Chroma", + dependencies: [ + .product(name: "ArgumentParser", package: "swift-argument-parser"), + .product(name: "Files", package: "Files") + ]), + .testTarget( + name: "ChromaTests", + dependencies: ["Chroma"]), + ] +) diff --git a/README.md b/README.md new file mode 100644 index 0000000..d863d55 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Chroma + +A command line tool to generate swift colors definitions from .xcassets files. diff --git a/Application/File.swift b/Sources/Chroma/File.swift similarity index 100% rename from Application/File.swift rename to Sources/Chroma/File.swift diff --git a/Application/Folder.swift b/Sources/Chroma/Folder.swift similarity index 100% rename from Application/Folder.swift rename to Sources/Chroma/Folder.swift diff --git a/Application/Generator.swift b/Sources/Chroma/Generator.swift similarity index 100% rename from Application/Generator.swift rename to Sources/Chroma/Generator.swift diff --git a/Application/Output.swift b/Sources/Chroma/Output.swift similarity index 100% rename from Application/Output.swift rename to Sources/Chroma/Output.swift diff --git a/Application/Platform.swift b/Sources/Chroma/Platform.swift similarity index 100% rename from Application/Platform.swift rename to Sources/Chroma/Platform.swift diff --git a/Application/main.swift b/Sources/Chroma/main.swift similarity index 100% rename from Application/main.swift rename to Sources/Chroma/main.swift diff --git a/Tests/ChromaTests/ChromaTests.swift b/Tests/ChromaTests/ChromaTests.swift new file mode 100644 index 0000000..253fa06 --- /dev/null +++ b/Tests/ChromaTests/ChromaTests.swift @@ -0,0 +1,15 @@ +import XCTest +@testable import Chroma + +final class ChromaTests: XCTestCase { + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertNotNil("Hello, World!") + } + + static var allTests = [ + ("testExample", testExample), + ] +} diff --git a/Tests/ChromaTests/XCTestManifests.swift b/Tests/ChromaTests/XCTestManifests.swift new file mode 100644 index 0000000..58a8916 --- /dev/null +++ b/Tests/ChromaTests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !canImport(ObjectiveC) +public func allTests() -> [XCTestCaseEntry] { + return [ + testCase(ChromaTests.allTests), + ] +} +#endif diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..923a737 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import ChromaTests + +var tests = [XCTestCaseEntry]() +tests += ChromaTests.allTests() +XCTMain(tests)