Generation des strings sans twine et generation des tags. Refactor de toutes les commandes strings (Twine, CustomStrings, Tags) dans une commande avec des sous commandes

This commit is contained in:
2022-01-10 12:01:09 +01:00
parent 4973b245ad
commit b0900c10cd
39 changed files with 1519 additions and 40 deletions

View File

@ -1,5 +1,5 @@
//
// File.swift
// FontToolError.swift
//
//
// Created by Thibaut Schmitt on 13/12/2021.
@ -7,7 +7,6 @@
import Foundation
enum FontToolError: Error {
case fcScan(String, Int32, String?)
case inputFolderNotFound(String)
@ -22,7 +21,7 @@ enum FontToolError: Error {
return " error:[FontTool] Input folder not found: \(inputFolder)"
case .fileNotExists(let filename):
return " error:[FontTool] File \(filename) does not exists "
return " error:[FontTool] File \(filename) does not exists"
}
}
}

View File

@ -9,27 +9,22 @@ import Foundation
import CLIToolCore
import ArgumentParser
/*
Lire l'infoPlist et check si les fonts dedans sont les memes que celles à générer
*/
//swift run -c release FontToolCore ./SampleFiles/Fonts/sampleFonts.txt --extension-output-path ~/Desktop --extension-name R2Font
struct FontTool: ParsableCommand {
static let defaultExtensionName = "UIFont"
@Flag(name: .customShort("f"), help: "Should force generation")
var forceGeneration = false
@Argument(help: "Input files where fonts ared defined.")
@Argument(help: "Input files where fonts ared defined.", transform: { $0.replaceTiltWithHomeDirectoryPath() })
var inputFile: String
@Option(help: "Path where to generate the extension.")
@Option(help: "Path where to generate the extension.", transform: { $0.replaceTiltWithHomeDirectoryPath() })
var extensionOutputPath: String
@Option(help: "Extension name. If not specified, it will generate an UIFont extension")
@Option(help: "Extension name. If not specified, it will generate an UIFont extension. Using default extension name will generate static property.")
var extensionName: String = Self.defaultExtensionName
@Option(help: "Extension suffix. Ex: MyApp, it will generate {extensionName}+ColorsMyApp.swift")
@Option(help: "Extension suffix. Ex: MyApp, it will generate {extensionName}+FontsMyApp.swift")
var extensionSuffix: String = ""
var extensionFileName: String { "\(extensionName)+Font\(extensionSuffix).swift" }