Génération de composant SwiftUI: Color et Image
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2022-10-31 16:21:32 +01:00
parent 0797667b25
commit 4f7d7e18b1
13 changed files with 258 additions and 11 deletions

View File

@ -22,6 +22,7 @@ struct Fonts: ParsableCommand {
static let toolName = "Fonts"
static let defaultExtensionName = "UIFont"
static let defaultExtensionNameSUI = "Font"
// MARK: - Command Options
@ -52,6 +53,11 @@ struct Fonts: ParsableCommand {
extensionName: options.extensionName,
extensionFilePath: options.extensionFilePath)
FontExtensionGenerator.writeSUIExtensionFile(fontsNames: fontsNames,
staticVar: options.staticMembers,
extensionName: options.extensionNameSwiftUI,
extensionFilePath: options.extensionFilePathSwiftUI)
print("Info.plist information:")
print("\(FontPlistGenerator.generatePlistUIAppsFontContent(for: fontsNames))")
@ -70,6 +76,13 @@ struct Fonts: ParsableCommand {
Fonts.exit(withError: error)
}
// Extension for UIKit and SwiftUI should have different name
guard options.extensionName != options.extensionNameSwiftUI else {
let error = FontsToolError.extensionNamesCollision(options.extensionName)
print(error.localizedDescription)
Fonts.exit(withError: error)
}
// Check if needed to regenerate
guard GeneratorChecker.shouldGenerate(force: options.forceGeneration,
inputFilePath: options.inputFile,