fix: Rebase tags
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
This commit is contained in:
@ -34,6 +34,7 @@ struct Generate: ParsableCommand {
|
||||
// Parse
|
||||
let configuration = ConfigurationFileParser.parse(options.configurationFile)
|
||||
print("Found configurations :")
|
||||
print(" - \(configuration.analytics.count) analytics configuration(s)")
|
||||
print(" - \(configuration.colors.count) colors configuration(s)")
|
||||
print(" - \(configuration.fonts.count) fonts configuration(s)")
|
||||
print(" - \(configuration.images.count) images configuration(s)")
|
||||
|
@ -13,6 +13,11 @@ enum GenerateError: Error {
|
||||
case commandError([String], String)
|
||||
case writeFile(String, String)
|
||||
|
||||
// Analytics
|
||||
|
||||
case missingElement(String)
|
||||
case invalidParameter(String)
|
||||
|
||||
var description: String {
|
||||
switch self {
|
||||
case .fileNotExists(let filename):
|
||||
@ -29,6 +34,12 @@ enum GenerateError: Error {
|
||||
|
||||
case .writeFile(let filename, let info):
|
||||
return "error: [\(Generate.toolName)] An error occured while writing file in \(filename): \(info)"
|
||||
|
||||
case .missingElement(let element):
|
||||
return "error: [\(Generate.toolName)] Missing \(element) for Matomo"
|
||||
|
||||
case .invalidParameter(let reason):
|
||||
return "error: [\(Generate.toolName)] Invalid parameter \(reason)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import Foundation
|
||||
|
||||
struct ConfigurationFile: Codable, CustomDebugStringConvertible {
|
||||
var architecture: ConfigurationArchitecture?
|
||||
var analytics: [AnalyticsConfiguration]
|
||||
var colors: [ColorsConfiguration]
|
||||
var fonts: [FontsConfiguration]
|
||||
var images: [ImagesConfiguration]
|
||||
@ -16,12 +17,15 @@ struct ConfigurationFile: Codable, CustomDebugStringConvertible {
|
||||
var tags: [TagsConfiguration]
|
||||
|
||||
var runnableConfigurations: [Runnable] {
|
||||
let runnables: [[Runnable]] = [colors, fonts, images, strings, tags]
|
||||
let runnables: [[Runnable]] = [analytics, colors, fonts, images, strings, tags]
|
||||
return Array(runnables.joined())
|
||||
}
|
||||
|
||||
var debugDescription: String {
|
||||
"""
|
||||
\(analytics)
|
||||
-----------
|
||||
-----------
|
||||
\(colors)
|
||||
-----------
|
||||
-----------
|
||||
@ -76,6 +80,47 @@ struct ConfigurationArchitecture: Codable {
|
||||
}
|
||||
}
|
||||
|
||||
struct AnalyticsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
let inputFile: String
|
||||
let target: String
|
||||
let extensionOutputPath: String
|
||||
let extensionName: String?
|
||||
let extensionSuffix: String?
|
||||
private let staticMembers: Bool?
|
||||
|
||||
var staticMembersOptions: Bool {
|
||||
if let staticMembers = staticMembers {
|
||||
return staticMembers
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
internal init(inputFile: String,
|
||||
target: String,
|
||||
extensionOutputPath: String,
|
||||
extensionName: String?,
|
||||
extensionSuffix: String?,
|
||||
staticMembers: Bool?) {
|
||||
self.inputFile = inputFile
|
||||
self.target = target
|
||||
self.extensionOutputPath = extensionOutputPath
|
||||
self.extensionName = extensionName
|
||||
self.extensionSuffix = extensionSuffix
|
||||
self.staticMembers = staticMembers
|
||||
}
|
||||
|
||||
var debugDescription: String {
|
||||
"""
|
||||
Analytics configuration:
|
||||
- Input file: \(inputFile)
|
||||
- Target: \(target)
|
||||
- Extension output path: \(extensionOutputPath)
|
||||
- Extension name: \(extensionName ?? "-")
|
||||
- Extension suffix: \(extensionSuffix ?? "-")
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
struct ColorsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
let inputFile: String
|
||||
let style: String
|
||||
@ -266,7 +311,7 @@ struct StringsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
|
||||
struct TagsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
let inputFile: String
|
||||
let target: String
|
||||
let lang: String
|
||||
let extensionOutputPath: String
|
||||
let extensionName: String?
|
||||
let extensionSuffix: String?
|
||||
@ -280,13 +325,13 @@ struct TagsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
}
|
||||
|
||||
internal init(inputFile: String,
|
||||
target: String,
|
||||
lang: String,
|
||||
extensionOutputPath: String,
|
||||
extensionName: String?,
|
||||
extensionSuffix: String?,
|
||||
staticMembers: Bool?) {
|
||||
self.inputFile = inputFile
|
||||
self.target = target
|
||||
self.lang = lang
|
||||
self.extensionOutputPath = extensionOutputPath
|
||||
self.extensionName = extensionName
|
||||
self.extensionSuffix = extensionSuffix
|
||||
@ -297,7 +342,7 @@ struct TagsConfiguration: Codable, CustomDebugStringConvertible {
|
||||
"""
|
||||
Tags configuration:
|
||||
- Input file: \(inputFile)
|
||||
- Target: \(target)
|
||||
- Lang: \(lang)
|
||||
- Extension output path: \(extensionOutputPath)
|
||||
- Extension name: \(extensionName ?? "-")
|
||||
- Extension suffix: \(extensionSuffix ?? "-")
|
||||
|
@ -17,8 +17,8 @@ extension TagsConfiguration: Runnable {
|
||||
|
||||
args += [
|
||||
inputFile.prependIfRelativePath(projectDirectory),
|
||||
"--target",
|
||||
target,
|
||||
"--lang",
|
||||
lang,
|
||||
"--extension-output-path",
|
||||
extensionOutputPath.prependIfRelativePath(projectDirectory),
|
||||
"--static-members",
|
||||
|
Reference in New Issue
Block a user