Skip to content

Commit 0c3b871

Browse files
authored
Remove cache_level input (#51)
1 parent baaabaa commit 0c3b871

File tree

4 files changed

+1
-48
lines changed

4 files changed

+1
-48
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ You can also run this step directly with [Bitrise CLI](https://github.com/bitris
6464
| `xcodebuild_options` | Additional options to be added to the executed xcodebuild command. Prefer using `Build settings (xcconfig)` input for specifying `-xcconfig` option. You can't use both. | | |
6565
| `log_formatter` | Defines how xcodebuild command's log is formatted. Available options: - `xcpretty`: The xcodebuild command's output will be prettified by xcpretty. - `xcodebuild`: Only the last 20 lines of raw xcodebuild output will be visible in the build log. The raw xcodebuild log will be exported in all cases. | required | `xcpretty` |
6666
| `output_dir` | This directory will contain the generated artifacts. | required | `$BITRISE_DEPLOY_DIR` |
67-
| `cache_level` | Defines what cache content should be automatically collected. Available options: - `none`: Disable collecting cache content - `swift_packages`: Collect Swift PM packages added to the Xcode project | required | `swift_packages` |
6867
| `verbose_log` | If this input is set, the Step will print additional logs for debugging. | required | `no` |
6968
</details>
7069

build.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,14 @@ import (
55
"fmt"
66
"io"
77
"os"
8-
"strings"
98

109
"github.com/bitrise-io/go-utils/colorstring"
1110
"github.com/bitrise-io/go-utils/command"
12-
"github.com/bitrise-io/go-utils/log"
1311
"github.com/bitrise-io/go-xcode/xcodebuild"
14-
cache "github.com/bitrise-io/go-xcode/xcodecache"
1512
"github.com/bitrise-io/go-xcode/xcpretty"
1613
"github.com/bitrise-steplib/steps-xcode-build-for-simulator/util"
1714
)
1815

19-
func runCommandWithRetry(cmd *xcodebuild.CommandBuilder, useXcpretty bool, swiftPackagesPath string) (string, error) {
20-
output, err := runCommand(cmd, useXcpretty)
21-
if err != nil && swiftPackagesPath != "" && strings.Contains(output, cache.SwiftPackagesStateInvalid) {
22-
log.Warnf("Build failed, swift packages cache is in an invalid state, error: %s", err)
23-
log.RWarnf("xcode-build-for-simulator", "swift-packages-cache-invalid", nil, "swift packages cache is in an invalid state")
24-
if err := os.RemoveAll(swiftPackagesPath); err != nil {
25-
return output, fmt.Errorf("failed to remove invalid Swift package caches, error: %s", err)
26-
}
27-
return runCommand(cmd, useXcpretty)
28-
}
29-
return output, err
30-
}
31-
3216
func prepareCommand(xcodeCmd *xcodebuild.CommandBuilder, useXcpretty bool, output *bytes.Buffer) (*command.Model, *xcpretty.CommandModel) {
3317
if useXcpretty {
3418
return nil, xcpretty.New(*xcodeCmd)

step.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/bitrise-io/go-utils/ziputil"
2121
"github.com/bitrise-io/go-xcode/v2/xcconfig"
2222
"github.com/bitrise-io/go-xcode/xcodebuild"
23-
cache "github.com/bitrise-io/go-xcode/xcodecache"
2423
"github.com/bitrise-io/go-xcode/xcpretty"
2524
"github.com/kballard/go-shellquote"
2625

@@ -49,9 +48,6 @@ type Config struct {
4948
// Output export
5049
OutputDir string `env:"output_dir,required"`
5150

52-
// Caching
53-
CacheLevel string `env:"cache_level,opt[none,swift_packages]"`
54-
5551
// Debugging
5652
VerboseLog bool `env:"verbose_log,required"`
5753
}
@@ -125,8 +121,6 @@ func (b BuildForSimulatorStep) ProcessConfig() (RunOpts, error) {
125121
LogFormatter: config.LogFormatter,
126122

127123
OutputDir: config.OutputDir,
128-
129-
CacheLevel: config.CacheLevel,
130124
}, nil
131125
}
132126

@@ -253,12 +247,7 @@ func (s BuildForSimulatorStep) Run(cfg RunOpts) (ExportOptions, error) {
253247
archiveCmd.SetXCConfigPath(xcconfigPath)
254248
}
255249

256-
swiftPackagesPath, err := cache.SwiftPackagesPath(absProjectPath)
257-
if err != nil {
258-
return ExportOptions{}, fmt.Errorf("failed to get Swift Packages path: %s", err)
259-
}
260-
261-
rawXcodeBuildOut, err := runCommandWithRetry(archiveCmd, cfg.LogFormatter == "xcpretty", swiftPackagesPath)
250+
rawXcodeBuildOut, err := runCommand(archiveCmd, cfg.LogFormatter == "xcpretty")
262251
if err != nil {
263252
if cfg.LogFormatter == "xcpretty" {
264253
log.Errorf("\nLast lines of the Xcode's build log:")

step.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -179,25 +179,6 @@ inputs:
179179
description: This directory will contain the generated artifacts.
180180
is_required: true
181181

182-
# Caching
183-
184-
- cache_level: swift_packages
185-
opts:
186-
category: Caching
187-
title: Enable collecting cache content
188-
summary: Defines what cache content should be automatically collected.
189-
description: |-
190-
Defines what cache content should be automatically collected.
191-
192-
Available options:
193-
194-
- `none`: Disable collecting cache content
195-
- `swift_packages`: Collect Swift PM packages added to the Xcode project
196-
is_required: true
197-
value_options:
198-
- none
199-
- swift_packages
200-
201182
# Debugging
202183

203184
- verbose_log: "no"

0 commit comments

Comments
 (0)