Skip to content

Commit

Permalink
Move knownAssetsGenerator to instance vars
Browse files Browse the repository at this point in the history
  • Loading branch information
kapitoshka438 committed Apr 23, 2024
1 parent e507df9 commit 8040c7a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ final class ProjectDescriptorGenerator: ProjectDescriptorGenerating {
/// Generator for the project schemes.
let schemeDescriptorsGenerator: SchemeDescriptorsGenerating

/// Generator for the project known asset tags associated with on-demand resources.
let knownAssetTagsGenerator: KnownAssetTagsGenerating

// MARK: - Init

/// Initializes the project generator with its attributes.
Expand All @@ -62,14 +65,17 @@ final class ProjectDescriptorGenerator: ProjectDescriptorGenerating {
/// - targetGenerator: Generator for the project targets.
/// - configGenerator: Generator for the project configuration.
/// - schemeDescriptorsGenerator: Generator for the project schemes.
/// - knownAssetTagsGenerator: Generator for the project known asset tags associated with on-demand resources.
init(
targetGenerator: TargetGenerating = TargetGenerator(),
configGenerator: ConfigGenerating = ConfigGenerator(),
schemeDescriptorsGenerator: SchemeDescriptorsGenerating = SchemeDescriptorsGenerator()
schemeDescriptorsGenerator: SchemeDescriptorsGenerating = SchemeDescriptorsGenerator(),
knownAssetTagsGenerator: KnownAssetTagsGenerating = KnownAssetTagsGenerator()
) {
self.targetGenerator = targetGenerator
self.configGenerator = configGenerator
self.schemeDescriptorsGenerator = schemeDescriptorsGenerator
self.knownAssetTagsGenerator = knownAssetTagsGenerator
}

// MARK: - ProjectGenerating
Expand Down Expand Up @@ -296,7 +302,7 @@ final class ProjectDescriptorGenerator: ProjectDescriptorGenerating {
var attributes: [String: Any] = [:]

// On Demand Resources tags
if let knownAssetTags = try? KnownAssetTagsGenerator().generate(project: project), !knownAssetTags.isEmpty {
if let knownAssetTags = try? knownAssetTagsGenerator.generate(project: project), !knownAssetTags.isEmpty {
attributes["KnownAssetTags"] = knownAssetTags
}

Expand Down

0 comments on commit 8040c7a

Please sign in to comment.