Add visibility parameters to control scope of generated extension
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:
@ -16,21 +16,25 @@ final class FontsConfigurationTests: XCTestCase {
|
||||
|
||||
func test_argsGeneration_requiredArgs() {
|
||||
// Given
|
||||
let testingConfiguration = FontsConfiguration(inputFile: "path/to/fonts.txt",
|
||||
extensionOutputPath: nil,
|
||||
extensionName: nil,
|
||||
extensionNameUIKit: nil,
|
||||
extensionSuffix: nil,
|
||||
infoPlistPaths: nil,
|
||||
staticMembers: nil)
|
||||
let testingConfiguration = FontsConfiguration(
|
||||
inputFile: "path/to/fonts.txt",
|
||||
extensionOutputPath: nil,
|
||||
extensionName: nil,
|
||||
extensionNameUIKit: nil,
|
||||
extensionSuffix: nil,
|
||||
infoPlistPaths: nil,
|
||||
visibility: nil,
|
||||
staticMembers: nil
|
||||
)
|
||||
// When
|
||||
let arguments = testingConfiguration.getArguments(projectDirectory: projectDirectory, force: false)
|
||||
let arguments = testingConfiguration.getArguments(
|
||||
projectDirectory: projectDirectory,
|
||||
force: false
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expectedArguments = [
|
||||
"projectDirectory/path/to/fonts.txt",
|
||||
"--static-members",
|
||||
"false"
|
||||
"projectDirectory/path/to/fonts.txt"
|
||||
]
|
||||
|
||||
XCTAssertEqual(arguments, expectedArguments)
|
||||
@ -38,22 +42,26 @@ final class FontsConfigurationTests: XCTestCase {
|
||||
|
||||
func test_argsGeneration_allArguments() {
|
||||
// Given
|
||||
let testingConfiguration = FontsConfiguration(inputFile: "path/to/fonts.txt",
|
||||
extensionOutputPath: "Fonts/Generated",
|
||||
extensionName: "AppUIFont",
|
||||
extensionNameUIKit: "AppFont",
|
||||
extensionSuffix: "Testing",
|
||||
infoPlistPaths: "path/to/plist1.plist path/to/plist2.plist",
|
||||
staticMembers: true)
|
||||
let testingConfiguration = FontsConfiguration(
|
||||
inputFile: "path/to/fonts.txt",
|
||||
extensionOutputPath: "Fonts/Generated",
|
||||
extensionName: "AppUIFont",
|
||||
extensionNameUIKit: "AppFont",
|
||||
extensionSuffix: "Testing",
|
||||
infoPlistPaths: "path/to/plist1.plist path/to/plist2.plist",
|
||||
visibility: "package",
|
||||
staticMembers: true
|
||||
)
|
||||
// When
|
||||
let arguments = testingConfiguration.getArguments(projectDirectory: projectDirectory, force: true)
|
||||
let arguments = testingConfiguration.getArguments(
|
||||
projectDirectory: projectDirectory,
|
||||
force: true
|
||||
)
|
||||
|
||||
// Expect
|
||||
let expectedArguments = [
|
||||
"-f",
|
||||
"projectDirectory/path/to/fonts.txt",
|
||||
"--static-members",
|
||||
"true",
|
||||
"--extension-output-path",
|
||||
"projectDirectory/Fonts/Generated",
|
||||
"--extension-name",
|
||||
@ -62,6 +70,10 @@ final class FontsConfigurationTests: XCTestCase {
|
||||
"AppFont",
|
||||
"--extension-suffix",
|
||||
"Testing",
|
||||
"--visibility",
|
||||
"package",
|
||||
"--static-members",
|
||||
"true",
|
||||
"--info-plist-paths",
|
||||
"projectDirectory/path/to/plist1.plist projectDirectory/path/to/plist2.plist"
|
||||
]
|
||||
|
Reference in New Issue
Block a user