Skip to content

Commit

Permalink
[#349] Improve the duplicated codes
Browse files Browse the repository at this point in the history
  • Loading branch information
phongvhd93 committed Dec 4, 2023
1 parent e778575 commit fcec223
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion Tuist/Interfaces/SwiftUI/Project/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ target 'Data' do
end

target 'Domain' do
# Pods for Domain
target 'DomainTests' do
testing_pods
end
Expand Down
2 changes: 0 additions & 2 deletions Tuist/Interfaces/UIKit/Project/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ end

target 'Data' do
data_dependencies

target 'DataTests' do
data_dependencies
testing_pods
end
end

target 'Domain' do
# Pods for Domain
target 'DomainTests' do
testing_pods
end
Expand Down
2 changes: 1 addition & 1 deletion Tuist/ProjectDescriptionHelpers/Module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public enum Module: CaseIterable {
}

public var sources: ProjectDescription.SourceFilesList {
return ["\(frameworkPath)/\(Constant.sourcesPath)/**"]
["\(frameworkPath)/\(Constant.sourcesPath)/**"]
}

public var resources: ProjectDescription.ResourceFileElements {
Expand Down
14 changes: 8 additions & 6 deletions Tuist/ProjectDescriptionHelpers/Scheme+Initializing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ extension Scheme {
public static func productionScheme(name: String) -> Scheme {
let debugConfigName = BuildConfiguration.debugProduction.name
let releaseConfigName = BuildConfiguration.releaseProduction.name

var testModules = Module.allCases.map { TestableTarget("\($0.name)\(Constant.testsPath)") }
testModules.append(contentsOf: ["\(name)Tests", "\(name)KIFUITests"])
let testModules = testSchemes(name)

return Scheme(
name: name,
Expand All @@ -24,9 +22,7 @@ extension Scheme {
public static func stagingScheme(name: String) -> Scheme {
let debugConfigName = BuildConfiguration.debugStaging.name
let releaseConfigName = BuildConfiguration.releaseStaging.name

var testModules = Module.allCases.map { TestableTarget("\($0.name)\(Constant.testsPath)") }
testModules.append(contentsOf: ["\(name)Tests", "\(name)KIFUITests"])
let testModules = testSchemes(name)

return Scheme(
name: "\(name) Staging",
Expand All @@ -47,4 +43,10 @@ extension Scheme {
hidden: true
)
}

private static func testSchemes(_ name: String) -> [TestableTarget] {
var modules = Module.allCases.map { TestableTarget("\($0.name)\(Constant.testsPath)") }
modules.append(contentsOf: ["\(name)Tests", "\(name)KIFUITests"])
return modules
}
}

0 comments on commit fcec223

Please sign in to comment.