Skip to content

Commit

Permalink
Release 1.2.1 (#236)
Browse files Browse the repository at this point in the history
* FIX: Reverting supporting-variants-and-pods-configs-simultaneously, that created 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 (#233)
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Nour Sandid <noursandid@gmail.com>
  • Loading branch information
arthurpalves authored Oct 26, 2023
1 parent 096ca0d commit 9caf67e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Sources/Variants/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct Variants: ParsableCommand {
static var configuration = CommandConfiguration(
commandName: "variants",
abstract: "A command-line tool to setup deployment variants and working CI/CD setup",
version: "1.2.0",
version: "1.2.1",
subcommands: [
Initializer.self,
Setup.self,
Expand Down
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
2 changes: 1 addition & 1 deletion docs/GITHUB_ACTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If Github Actions is your CI and you use the [Github-hosted macOS runner](https:
```yaml
- uses: backbase/variants@main
with:
version: 1.2.0
version: 1.2.1
spec: variants.yml
platform: ios
variant: beta
Expand Down

0 comments on commit 9caf67e

Please sign in to comment.