Skip to content

Commit 3f19ebc

Browse files
authored
Use generic simulator (#40)
No longer requires a specific Simulator device to be available, as we target generic devices (for example: generic/platform=iOS Simulator). Applied new Input config standards. - New input: destination input, to specify a generic device: Destination specifier describes the device to use as a destination. Can be one of: generic/platform=iOS Simulator, generic/platform=watchOS Simulator, generic/platform=tvOS Simulator. destination replaces the now removed simulator_device, simulator_os_version and simulator_platform. - New input: Build settings (xcconfig_content). Allows you to override the project's build settings. Creates a temporary file with the given input value as content and passes it to xcodebuild as the -xcconfig parameter. - Removed code_signing_allowed in favor of xcconfig_content. To enable code signing, set CODE_SIGNING_ALLOWED=YES in the xcconfig_content Input. - Removed disable_index_while_building. - Renamed is_clean_build to perform_clean_action. - Renamed output_tool to log_formatter. Can be xcpretty or xcodebuild as before.
1 parent c86330c commit 3f19ebc

File tree

158 files changed

+6562
-7732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+6562
-7732
lines changed

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,16 @@ You can also run this step directly with [Bitrise CLI](https://github.com/bitris
5555

5656
| Key | Description | Flags | Default |
5757
| --- | --- | --- | --- |
58-
| `project_path` | Xcode Project (`.xcodeproj`) or Workspace (`.xcworkspace`) path. _xcodebuild steps:_ The input value sets xcodebuild's `-project` or `-workspace` option. | required | `$BITRISE_PROJECT_PATH` |
59-
| `scheme` | Xcode Scheme name. _xcodebuild steps:_ The input value sets xcodebuild's `-scheme` option. | required | `$BITRISE_SCHEME` |
60-
| `simulator_device` | Set this exactly as it appears in the device selection menu in Xcode's device selection UI. A couple of examples (the actual available options depend on which versions are installed): * iPhone 8 Plus * iPhone Xs Max * iPad Air (3rd generation) * iPad Pro (12.9-inch) (3rd generation) * Apple TV 4K Don't forget to set the platform to `tvOS Simulator` in order to use an Apple TV simulator. | required | `iPhone 8 Plus` |
61-
| `simulator_os_version` | Set this exactly as it appears in Xcode's device selection UI. A couple of format examples (the actual available options depend on which versions are installed): * "8.4" * latest | required | `latest` |
62-
| `simulator_platform` | Set this exactly as it appears in Xcode's device selection UI. A couple of examples (the actual available options depend on which versions are installed): * iOS Simulator * tvOS Simulator | required | `iOS` |
63-
| `configuration` | (Optional) The name of the Xcode Configuration to use (Debug, Release, etc.). By default your Scheme's archive action defines which Configuration should be used, but this can be overridden it with this option. **If the Configuration specified in this input does not exist in your project, the Step will silently ignore the value, and fall back to using the Configuration specified in the Scheme.** | | |
64-
| `disable_index_while_building` | When this input is enabled, `COMPILER_INDEX_STORE_ENABLE=NO` is added to the `xcodebuild` command, which disables indexing while building. Disabling this could speed up your builds by eliminating a (normally) unnecessary step. Indexing is useful for certain editor features — like autocompletion, jump to definition, and code information lookup — but these features are generally not necessary in a CI environment. | | `yes` |
65-
| `code_signing_allowed` | When building an app for the simulator, code signing is not required and is set to "no" by default. On rare occasions, you may need to set the flag to "yes" — usually when working with certain test cases or third-party dependencies. | | `no` |
66-
| `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` |
67-
| `xcodebuild_options` | Additional options to be added to the executed xcodebuild command. | | |
68-
| `workdir` | The working directory of the Step | | `$BITRISE_SOURCE_DIR` |
58+
| `project_path` | Path of the Xcode Project (`.xcodeproj`) or Workspace (`.xcworkspace`) The input value sets xcodebuild's `-project` or `-workspace` option. | required | `$BITRISE_PROJECT_PATH` |
59+
| `scheme` | Xcode Scheme name. The input value sets xcodebuild's `-scheme` option. | required | `$BITRISE_SCHEME` |
60+
| `destination` | Destination specifier describes the device to use as a destination. The input value sets xcodebuild's `-destination` option. | required | `generic/platform=iOS Simulator` |
61+
| `xcconfig_content` | Build settings to override the project's build settings, using xcodebuild's `-xcconfig` option. *Code signing allowed: Whether or not to allow code signing for this build* When building an app for the simulator, code signing is not required and is set to "no" by default. On rare occasions, you may need to set the flag to "yes" — usually when working with certain test cases or third-party dependencies. You can't define `-xcconfig` option in `Additional options for the xcodebuild command` if this input is set. If empty, no setting is changed. When set it can be either: 1. Existing `.xcconfig` file path. Example: `./ios-sample/ios-sample/Configurations/Dev.xcconfig` 2. The contents of a newly created temporary `.xcconfig` file. (This is the default.) Build settings must be separated by newline character (`\n`). Example: ``` COMPILER_INDEX_STORE_ENABLE = NO ONLY_ACTIVE_ARCH[config=Debug][sdk=*][arch=*] = YES ``` | | `CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE = NO` |
62+
| `configuration` | Xcode Build Configuration. If not specified, the default Build Configuration will be used. (Defined in the Scheme's archive action ) The input value sets xcodebuild's `-configuration` option. **If the Configuration specified in this input does not exist in your project, the Step will silently ignore the value, and fall back to using the Configuration specified in the Scheme.** | | |
63+
| `perform_clean_action` | If this input is set, `clean` xcodebuild action will be performed besides the `build` action. | required | `no` |
64+
| `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. | | |
65+
| `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` |
6966
| `output_dir` | This directory will contain the generated artifacts. | required | `$BITRISE_DEPLOY_DIR` |
70-
| `is_clean_build` | Whether or not to do a clean build before building | required | `no` |
71-
| `output_tool` | 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 both cases. | required | `xcpretty` |
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` |
7268
| `verbose_log` | If this input is set, the Step will print additional logs for debugging. | required | `no` |
7369
</details>
7470

bitrise.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
format_version: "11"
22
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
33

4-
app:
5-
envs:
6-
- BITRISE_STEP_GIT_CLONE_URL: https://github.com/bitrise-steplib/steps-xcode-build-for-simulator.git
7-
- MY_STEPLIB_REPO_FORK_GIT_URL: $MY_STEPLIB_REPO_FORK_GIT_URL
8-
- ORIG_BITRISE_SOURCE_DIR: $BITRISE_SOURCE_DIR
9-
104
workflows:
115
sample:
126
envs:

e2e/bitrise.yml

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
format_version: "11"
22
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
33

4+
app:
5+
envs:
6+
- ORIG_BITRISE_SOURCE_DIR: $BITRISE_SOURCE_DIR
7+
48
workflows:
59
test_objc:
610
envs:
@@ -9,12 +13,11 @@ workflows:
913
- BRANCH: master
1014
- BITRISE_PROJECT_PATH: ios-simple-objc/ios-simple-objc.xcodeproj
1115
- BITRISE_SCHEME: ios-simple-objc
12-
- OUTPUT_TOOL: xcodebuild
13-
- SIMULATOR_OS_VERSION: latest
16+
- XCONFIG_CONTENT: CODE_SIGNING_ALLOWED=NO
17+
- LOG_FORMATTER: xcodebuild
1418
- OUTPUT_DIR: $BITRISE_DEPLOY_DIR
1519
- BITRISE_APP_DIR_PATH_EXPECTED: $BITRISE_DEPLOY_DIR/ios-simple-objc.app
1620
- BITRISE_APP_DIR_PATH_LIST_EXPECTED: $BITRISE_DEPLOY_DIR/ios-simple-objc.app
17-
- CODE_SIGNING_ALLOWED: "no"
1821
after_run:
1922
- _common
2023

@@ -25,12 +28,11 @@ workflows:
2528
- BRANCH: master
2629
- BITRISE_PROJECT_PATH: code-sign-test.xcodeproj
2730
- BITRISE_SCHEME: code-sign-test
28-
- SIMULATOR_OS_VERSION: latest
29-
- OUTPUT_TOOL: xcpretty
31+
- XCONFIG_CONTENT: CODE_SIGNING_ALLOWED=NO
32+
- LOG_FORMATTER: xcpretty
3033
- OUTPUT_DIR: $BITRISE_DEPLOY_DIR
3134
- BITRISE_APP_DIR_PATH_EXPECTED: $BITRISE_DEPLOY_DIR/code-sign-test.app
3235
- BITRISE_APP_DIR_PATH_LIST_EXPECTED: $BITRISE_DEPLOY_DIR/code-sign-test.app|$BITRISE_DEPLOY_DIR/watchkit-app.app
33-
- CODE_SIGNING_ALLOWED: "no"
3436
after_run:
3537
- _common
3638

@@ -41,12 +43,11 @@ workflows:
4143
- BRANCH: master
4244
- BITRISE_PROJECT_PATH: sample-apps-ios-workspace-swift.xcworkspace
4345
- BITRISE_SCHEME: sample-apps-ios-workspace-swift
44-
- SIMULATOR_OS_VERSION: latest
45-
- OUTPUT_TOOL: xcpretty
46+
- XCONFIG_CONTENT: CODE_SIGNING_ALLOWED=NO
47+
- LOG_FORMATTER: xcpretty
4648
- OUTPUT_DIR: $BITRISE_DEPLOY_DIR
4749
- BITRISE_APP_DIR_PATH_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app
4850
- BITRISE_APP_DIR_PATH_LIST_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app
49-
- CODE_SIGNING_ALLOWED: "no"
5051
after_run:
5152
- _common
5253

@@ -57,12 +58,11 @@ workflows:
5758
- BRANCH: scheme-in-workspace
5859
- BITRISE_PROJECT_PATH: sample-apps-ios-workspace-swift.xcworkspace
5960
- BITRISE_SCHEME: sample-apps-ios-workspace-swift-workspace
60-
- SIMULATOR_OS_VERSION: latest
61-
- OUTPUT_TOOL: xcpretty
61+
- XCONFIG_CONTENT: CODE_SIGNING_ALLOWED=NO
62+
- LOG_FORMATTER: xcpretty
6263
- OUTPUT_DIR: $BITRISE_DEPLOY_DIR
6364
- BITRISE_APP_DIR_PATH_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app
6465
- BITRISE_APP_DIR_PATH_LIST_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app
65-
- CODE_SIGNING_ALLOWED: "no"
6666
after_run:
6767
- _common
6868

@@ -73,12 +73,11 @@ workflows:
7373
- BRANCH: watch
7474
- BITRISE_PROJECT_PATH: sample-apps-ios-workspace-swift.xcworkspace
7575
- BITRISE_SCHEME: sample-apps-ios-workspace-swift
76-
- SIMULATOR_OS_VERSION: latest
77-
- OUTPUT_TOOL: xcodebuild
76+
- XCONFIG_CONTENT: CODE_SIGNING_ALLOWED=NO
77+
- LOG_FORMATTER: xcodebuild
7878
- OUTPUT_DIR: $BITRISE_DEPLOY_DIR
7979
- BITRISE_APP_DIR_PATH_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app
8080
- BITRISE_APP_DIR_PATH_LIST_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app|$BITRISE_DEPLOY_DIR/bitfall.sample-apps-ios-workspace-swift-watch.app
81-
- CODE_SIGNING_ALLOWED: "no"
8281
after_run:
8382
- _common
8483

@@ -89,12 +88,11 @@ workflows:
8988
- BRANCH: watch
9089
- BITRISE_PROJECT_PATH: sample-apps-ios-workspace-swift.xcworkspace
9190
- BITRISE_SCHEME: sample-apps-ios-workspace-swift
92-
- SIMULATOR_OS_VERSION: latest
93-
- OUTPUT_TOOL: xcpretty
91+
- XCONFIG_CONTENT: CODE_SIGNING_ALLOWED=NO
92+
- LOG_FORMATTER: xcpretty
9493
- OUTPUT_DIR: $BITRISE_DEPLOY_DIR
9594
- BITRISE_APP_DIR_PATH_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app
9695
- BITRISE_APP_DIR_PATH_LIST_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app|$BITRISE_DEPLOY_DIR/bitfall.sample-apps-ios-workspace-swift-watch.app
97-
- CODE_SIGNING_ALLOWED: "no"
9896
after_run:
9997
- _common
10098

@@ -105,12 +103,11 @@ workflows:
105103
- BRANCH: watch
106104
- BITRISE_PROJECT_PATH: sample-apps-ios-workspace-swift.xcworkspace
107105
- BITRISE_SCHEME: sample-apps-ios-workspace-swift
108-
- SIMULATOR_OS_VERSION: latest
109-
- OUTPUT_TOOL: xcpretty
106+
- XCONFIG_CONTENT: CODE_SIGNING_ALLOWED=YES
107+
- LOG_FORMATTER: xcpretty
110108
- OUTPUT_DIR: $BITRISE_DEPLOY_DIR
111109
- BITRISE_APP_DIR_PATH_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app
112110
- BITRISE_APP_DIR_PATH_LIST_EXPECTED: $BITRISE_DEPLOY_DIR/sample-apps-ios-workspace-swift.app|$BITRISE_DEPLOY_DIR/bitfall.sample-apps-ios-workspace-swift-watch.app
113-
- CODE_SIGNING_ALLOWED: "yes"
114111
after_run:
115112
- _common
116113

@@ -167,13 +164,10 @@ workflows:
167164
- path::./:
168165
title: Execute step
169166
inputs:
170-
- simulator_os_version: $SIMULATOR_OS_VERSION
171-
- output_tool: $OUTPUT_TOOL
172-
opts:
173-
is_expand: true
167+
- xcconfig_content: $XCCONFIG_CONTENT
174168
- xcodebuild_options: $XCODEBUILD_OPTIONS
169+
- log_formatter: $LOG_FORMATTER
175170
- verbose_log: "yes"
176-
- code_signing_allowed: $CODE_SIGNING_ALLOWED
177171
- script:
178172
title: Output check
179173
inputs:

go.mod

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@ module github.com/bitrise-steplib/steps-xcode-build-for-simulator
33
go 1.17
44

55
require (
6-
github.com/bitrise-io/go-steputils v1.0.1
7-
github.com/bitrise-io/go-utils v1.0.1
8-
github.com/bitrise-io/go-xcode v1.0.6
9-
github.com/bitrise-io/xcode-project v0.0.0-20191217120050-389cf29e41c7
10-
github.com/bitrise-steplib/steps-xcode-archive v0.0.0-20191210145211-8b2aa80d6c8d
6+
github.com/bitrise-io/go-steputils v1.0.3
7+
github.com/bitrise-io/go-utils v1.0.3
8+
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.11
9+
github.com/bitrise-io/go-xcode v1.0.9
10+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.23
1111
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
1212
)
1313

1414
require (
15-
github.com/bitrise-io/pkcs12 v0.0.0-20211108084543-e52728e011c8 // indirect
16-
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa // indirect
15+
github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10 // indirect
1716
github.com/google/go-cmp v0.5.8 // indirect
18-
github.com/hashicorp/go-version v1.3.0 // indirect
19-
github.com/pkg/errors v0.9.1 // indirect
20-
github.com/ryanuber/go-glob v1.0.0 // indirect
21-
github.com/stretchr/testify v1.7.1 // indirect
22-
golang.org/x/text v0.3.7 // indirect
23-
howett.net/plist v1.0.0 // indirect
17+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
18+
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
19+
github.com/hashicorp/go-version v1.6.0 // indirect
20+
golang.org/x/text v0.4.0 // indirect
2421
)

0 commit comments

Comments
 (0)