Basic project creation (#3)

This PR contains the work done to create a new *Hummingbird* project with very basic configuration from the _colibri_ executable, just like the project you could create with the [Hummingbird template](https://github.com/hummingbird-project/template) project in Github.

Reviewed-on: #3
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #3.
This commit is contained in:
2025-01-28 00:07:24 +00:00
committed by Javier Cicchelli
parent b8c354e614
commit 9be8fa4a31
52 changed files with 1936 additions and 475 deletions
@@ -0,0 +1,74 @@
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
extension File {
// MARK: Computed
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 {
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 {
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
}
}
}
// MARK: - CaseIterable
extension File: CaseIterable {}
@@ -0,0 +1,48 @@
enum Folder {
case app
case libraryPublic
case libraryInternal
case root
case testCasesPublic
case testCasesInternal
case testHelpers
}
// MARK: - Properties
extension Folder {
// MARK: Computed
var path: String {
switch self {
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/"
}
}
}
// MARK: - CaseIterable
extension Folder: CaseIterable {
// MARK: Properties
static var allCases: [Folder] {[
.app,
.libraryPublic,
.libraryInternal,
.testCasesPublic,
.testCasesInternal,
.testHelpers
]}
static var allCasesWithRoot: [Folder] { [.root] + Folder.allCases }
}