Skip to content

Commit

Permalink
Reverting supporting-variants-and-pods-configs-simultaneously, that c…
Browse files Browse the repository at this point in the history
…reated a bug which cause the UITests project to import an unneeded pod used by the app project, since the xcconfig is shared between the app and the tests projects
  • Loading branch information
noursandid committed Oct 26, 2023
1 parent c714588 commit ed43656
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
17 changes: 0 additions & 17 deletions Sources/VariantsCore/Factory/iOS/XCConfigFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ class XCConfigFactory: XCFactory {

private func populateConfig(with target: NamedTarget, configFile: Path, variant: iOSVariant) {
logger.logInfo("Populating: ", item: "'\(configFile.lastComponent)'")
importPodsIfNeeded(target: target, configFile: configFile)
variant.getDefaultValues(for: target.value).forEach { (key, value) in
let stringContent = "\(key) = \(value)"
logger.logDebug("Item: ", item: stringContent, indentationLevel: 1, color: .purple)
Expand Down Expand Up @@ -197,22 +196,6 @@ class XCConfigFactory: XCFactory {
xcodeFactory.modify(mainTargetSettings, in: projectPath, target: target.value)
}

private func importPodsIfNeeded(target: NamedTarget, configFile: Path) {
guard StaticPath.Pod.podFileFile.exists else { return }
// this regex finds a folder that starts with Pods and ends with the target key, with a ".release.xcconfig" extension.
let podConfigFileRegex: String = "./Pods/Target Support Files/Pods.*-\(target.key)/.*\\.release\\.xcconfig"
guard let podsConfigFile: String = try? Bash("find | head -n 1", arguments: ".", "-regex", podConfigFileRegex).capture(),
!podsConfigFile.isEmpty else {
logger.logError("", item: "Failed to import Pods config in .xcconfig, Pod config file not found")
return
}
let includeStatement = "#include \"\(podsConfigFile)\""
let (success, _) = write(includeStatement, toFile: configFile, force: false)
if !success {
logger.logError("", item: "Failed to add item to .xcconfig")
}
}

private func updateInfoPlist(with target: iOSTarget, configFile: Path, variant: iOSVariant) {
let configFilePath = configFile.absolute().description
do {
Expand Down
4 changes: 0 additions & 4 deletions Sources/VariantsCore/Helpers/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ struct StaticPath {
static let variantsFileName = "Variants.swift"
}

struct Pod {
static let podFileFile = Path("Podfile")
}

struct Template {
static let variantsScriptFileName = "variants-template.gradle"
static let fastlaneParametersFileName = "variants_params_template.rb"
Expand Down

0 comments on commit ed43656

Please sign in to comment.