Added some more cases to the File enumeration in the library target.
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
enum File: String {
|
||||
case app = "App"
|
||||
case appArguments = "AppArguments"
|
||||
case appBuilder = "AppBuilder"
|
||||
case appOptions = "AppOptions"
|
||||
case appTests = "AppTests"
|
||||
case dockerFile = "DockerFile"
|
||||
case dockerIgnore = "DockerIgnore"
|
||||
case environment = "Environment"
|
||||
case gitIgnore = "GitIgnore"
|
||||
case license = "License"
|
||||
case loggerLevel = "LoggerLevel"
|
||||
case package = "Package"
|
||||
case readme = "Readme"
|
||||
case testArguments = "TestArguments"
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -15,30 +24,46 @@ extension File {
|
||||
|
||||
var fileName: String {
|
||||
switch self {
|
||||
case .app: "App.swift"
|
||||
case .appArguments: "AppArguments.swift"
|
||||
case .appBuilder: "AppBuilder.swift"
|
||||
case .appOptions: "AppOptions.swift"
|
||||
case .appTests: "AppTests.swift"
|
||||
case .dockerFile: "Dockerfile"
|
||||
case .dockerIgnore: ".dockerignore"
|
||||
case .environment: "Environment+Properties.swift"
|
||||
case .gitIgnore: ".gitignore"
|
||||
case .license: "LICENSE"
|
||||
case .loggerLevel: "LoggerLevel+Conformances.swift"
|
||||
case .readme: "README.md"
|
||||
case .package: "Package.swift"
|
||||
case .testArguments: "TestArguments.swift"
|
||||
}
|
||||
}
|
||||
|
||||
var filePath: String {
|
||||
switch self {
|
||||
default: folder.path + fileName
|
||||
}
|
||||
folder.path + fileName
|
||||
}
|
||||
|
||||
var folder: Folder {
|
||||
switch self {
|
||||
case .app, .appOptions: .app
|
||||
case .appArguments, .appBuilder: .libraryPublic
|
||||
case .appTests: .testCasesPublic
|
||||
case .environment, .loggerLevel: .libraryInternal
|
||||
case .testArguments: .testHelpers
|
||||
default: .root
|
||||
}
|
||||
}
|
||||
|
||||
var resourcePath: String {
|
||||
switch self {
|
||||
default: "Resources/Files/Sources"
|
||||
let basePath = "Resources/Files/Sources"
|
||||
|
||||
return switch self {
|
||||
case .app, .appOptions: "\(basePath)/App"
|
||||
case .appArguments, .appBuilder, .environment, .loggerLevel: "\(basePath)/Library"
|
||||
case .appTests, .testArguments: "\(basePath)/Test"
|
||||
default: basePath
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,13 @@ extension Folder {
|
||||
|
||||
var path: String {
|
||||
switch self {
|
||||
case .app: "App/Sources"
|
||||
case .libraryPublic: "Library/Sources/Public"
|
||||
case .libraryInternal: "Library/Sources/Internal"
|
||||
case .app: "App/Sources/"
|
||||
case .libraryPublic: "Library/Sources/Public/"
|
||||
case .libraryInternal: "Library/Sources/Internal/"
|
||||
case .root: ""
|
||||
case .testCasesPublic: "Test/Sources/Cases/Public"
|
||||
case .testCasesInternal: "Test/Sources/Cases/Internal"
|
||||
case .testHelpers: "Test/Sources/Helpers"
|
||||
case .testCasesPublic: "Test/Sources/Cases/Public/"
|
||||
case .testCasesInternal: "Test/Sources/Cases/Internal/"
|
||||
case .testHelpers: "Test/Sources/Helpers/"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user