Skip to content

Commit

Permalink
Some minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
KC-2001MS committed Jul 30, 2024
1 parent c42c804 commit 11535d1
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 79 deletions.
6 changes: 3 additions & 3 deletions .swiftpm/configuration/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"originHash" : "1497425b214219aecb92bd89498fd7890755d32f185234884ef4d94b88c5d4b7",
"originHash" : "f8e6a1eb55a5e389ff30f3022787f2ae6f05ba7e54bde01c50cc53f7612297a1",
"pins" : [
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
"version" : "1.4.0"
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
"version" : "1.5.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,6 @@
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "SwiftLI"
BuildableName = "SwiftLI"
BlueprintName = "SwiftLI"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "sclt"
BuildableName = "sclt"
BlueprintName = "sclt"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
Expand Down Expand Up @@ -66,31 +36,13 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "sclt"
BuildableName = "sclt"
BlueprintName = "sclt"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "sclt"
BuildableName = "sclt"
BlueprintName = "sclt"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
14 changes: 3 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.10
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -16,9 +16,8 @@ let package = Package(
.executable(name: "sclt", targets: ["sclt"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.4.0"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"),
.package(url: "https://github.com/apple/swift-testing.git", from: "0.10.0"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
.package(url: "https://github.com/apple/swift-docc-plugin.git", from: "1.3.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand All @@ -32,12 +31,5 @@ let package = Package(
"SwiftLI"
]
),
.testTarget(
name: "SwiftLITests",
dependencies: [
.product(name: "Testing", package: "swift-testing"),
"SwiftLI"
]
),
]
)
43 changes: 43 additions & 0 deletions Package@swift-6.0.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "SwiftLI",
platforms: [
.macOS(.v11),
],
products: [
.library(
name: "SwiftLI",
targets: ["SwiftLI"]
),
.executable(name: "sclt", targets: ["sclt"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
.package(url: "https://github.com/apple/swift-docc-plugin.git", from: "1.3.0"),
.package(url: "https://github.com/apple/swift-testing.git", from: "0.10.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "SwiftLI"),
.executableTarget(
name: "sclt",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"SwiftLI"
]
),
.testTarget(
name: "SwiftLITests",
dependencies: [
.product(name: "Testing", package: "swift-testing"),
"SwiftLI"
]
),
]
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The following environment is required to use this library.

<p align="center">
<img src="https://img.shields.io/badge/macOS-11.0+-red.svg" />
<img src="https://img.shields.io/badge/Swift-5.10-DE5D43.svg" />
<img src="https://img.shields.io/badge/Swift-5.9-DE5D43.svg" />
<a href="https://twitter.com/IroIro1234work">
<img src="https://img.shields.io/badge/Contact-@IroIro1234work-lightgrey.svg?style=flat" alt="Twitter: @IroIro1234work" />
</a>
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftLI/Style/BlinkStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


/// Blinking Method
public enum BlinkStyle: String, CaseIterable {
public enum BlinkStyle: String, CaseIterable, Sendable {
case none = "0"
case `default` = "5"
// Removed because it does not work with macOS terminal app
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftLI/Style/Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


/// A representation of a color that adapts to a given context.
public enum Color {
public enum Color: Sendable {

case black
case red
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftLI/Style/LineStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


/// Specify the line type of the Divider
public enum LineStyle: CaseIterable {
public enum LineStyle: CaseIterable, Sendable {
case `default`
case double_line
}
2 changes: 1 addition & 1 deletion Sources/SwiftLI/Style/Weight.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


/// A weight to use for fonts.
public enum Weight: String, CaseIterable {
public enum Weight: String, CaseIterable, Sendable {
case `default` = "0"
case bold = "1"
case thin = "2"
Expand Down
2 changes: 1 addition & 1 deletion Sources/sclt/Subcommands/Break.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ArgumentParser
import SwiftLI

struct BreakCommand: ParsableCommand {
static var configuration = CommandConfiguration(
static let configuration = CommandConfiguration(
commandName: "break",
abstract: "Display of Break structure",
discussion: """
Expand Down
2 changes: 1 addition & 1 deletion Sources/sclt/Subcommands/Group.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ArgumentParser
import SwiftLI

struct GroupCommand: ParsableCommand {
static var configuration = CommandConfiguration(
static let configuration = CommandConfiguration(
commandName: "group",
abstract: "Display of Group structure",
discussion: """
Expand Down
2 changes: 1 addition & 1 deletion Sources/sclt/Subcommands/HDivider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ArgumentParser
import SwiftLI

struct HDividerCommand: ParsableCommand {
static var configuration = CommandConfiguration(
static let configuration = CommandConfiguration(
commandName: "hdivider",
abstract: "Display of HDivider structure",
discussion: """
Expand Down
2 changes: 1 addition & 1 deletion Sources/sclt/Subcommands/Label.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftLI


struct LabelCommand: ParsableCommand {
static var configuration = CommandConfiguration(
static let configuration = CommandConfiguration(
commandName: "label",
abstract: "Display of Label structure",
discussion: """
Expand Down
2 changes: 1 addition & 1 deletion Sources/sclt/Subcommands/Spacer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ArgumentParser
import SwiftLI

struct SpacerCommand: ParsableCommand {
static var configuration = CommandConfiguration(
static let configuration = CommandConfiguration(
commandName: "spacer",
abstract: "Display of HSpacer structure",
discussion: """
Expand Down
2 changes: 1 addition & 1 deletion Sources/sclt/Subcommands/SwiftLogo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ArgumentParser
import SwiftLI

struct SwiftLogoCommand: ParsableCommand {
static var configuration = CommandConfiguration(
static let configuration = CommandConfiguration(
commandName: "swift",
abstract: "Display of SwiftLogo structure",
discussion: """
Expand Down
2 changes: 1 addition & 1 deletion Sources/sclt/Subcommands/Text.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ArgumentParser
import SwiftLI

struct TextCommand: ParsableCommand {
static var configuration = CommandConfiguration(
static let configuration = CommandConfiguration(
commandName: "text",
abstract: "Display of Text structure",
discussion: """
Expand Down
2 changes: 1 addition & 1 deletion Sources/sclt/SwiftLI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ArgumentParser
//https://100rabh.medium.com/cli-tool-in-swift-using-swift-argument-parser-subcommands-and-flags-77ee31d9ac99
@main
struct scltCommand: ParsableCommand {
static var configuration = CommandConfiguration(
static let configuration = CommandConfiguration(
commandName: "sclt",
abstract: "Command line tool to check SwiftLI operation",
discussion: """
Expand Down
10 changes: 6 additions & 4 deletions Tests/SwiftLITests/SwiftLITests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if swift(>=6.0)
import Testing
@testable import SwiftLI
import Foundation
Expand Down Expand Up @@ -86,10 +87,10 @@ struct TextTests {
let text3 = Text(header: string, repeating: character, count: int, footer: false)
let text4 = Text(header: string, content: string, footer: false)

#expect(text1.content == string)
#expect(text2.content == String(repeating: character, count: int))
#expect(text3.content == String(repeating: character, count: int))
#expect(text4.content == string)
#expect(text1.contents == [string])
#expect(text2.contents == [String(repeating: character, count: int)])
#expect(text3.contents == [String(repeating: character, count: int)])
#expect(text4.contents == [string])
}

@Test("Is the value of the footer variable correct when initialized?", arguments: [(randomStrings, randomInt, randomCharacter)])
Expand Down Expand Up @@ -616,3 +617,4 @@ struct EmoticonTests {
}
}
}
#endif

0 comments on commit 11535d1

Please sign in to comment.