Skip to content

Commit

Permalink
feat(ios): Added an ios_build job (react-native-community#30 by @ro…
Browse files Browse the repository at this point in the history
  • Loading branch information
roni-castro authored and matt-oakes committed Jan 4, 2020
1 parent 6ef6cf8 commit b607782
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ workflows:
requires:
- build_android_release


# Build the iOS app in release mode and do not run tests
- rn/ios_build:
name: build_ios_release
project_path: ios/Example.xcodeproj
device: "iPhone X"
build_configuration: Release
scheme: Example
requires:
- analyse_js

# Build and test the iOS app in release mode
- rn/ios_build_and_test:
project_path: "ios/Example.xcodeproj"
Expand Down
10 changes: 10 additions & 0 deletions src/examples/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ usage:
requires:
- build_android_release

# Build the iOS app in release mode and do not run tests
- rn/ios_build:
name: build_ios_release
project_path: ios/Example.xcodeproj
device: "iPhone X"
build_configuration: Release
scheme: Example
requires:
- analyse_js

# Build and test the iOS app in release mode
- rn/ios_build_and_test:
project_path: "ios/Example.xcodeproj"
Expand Down
10 changes: 10 additions & 0 deletions src/examples/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ usage:
requires:
- checkout_code

# Build the iOS app in release mode and do not run tests
- rn/ios_build:
name: build_ios_release
project_path: ios/Example.xcodeproj
device: "iPhone X"
build_configuration: Release
scheme: Example
requires:
- analyse_js

# Build and test the iOS app in release mode
- rn/ios_build_and_test:
project_path: "ios/Example.xcodeproj"
Expand Down
70 changes: 70 additions & 0 deletions src/jobs/ios_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
description: Builds the iOS app at the given path with the given build scheme

executor: macos

parameters:
# For this job
checkout:
description: Boolean for whether or not to checkout as a first step. Default is false.
type: boolean
default: false
attach_workspace:
description: Boolean for whether or not to attach to an existing workspace. Default is true.
type: boolean
default: true
workspace_root:
description: Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory).
type: string
default: .
start_metro:
description: If we should start the Metro packager in the background for this job.
type: boolean
default: false
# For the iOS build command
project_type:
description: If the iOS app is built using a project file (*.xcodeproj) or a workspace.
type: enum
enum: ["project", "workspace"]
default: "project"
project_path:
description: The path to the Xcode project (*.xcodeproj) or the Xcode workspace (*.xcworkspace) that you want to build, relative to the root of the repository.
type: string
build_configuration:
description: The build configuration to use. This is normally either "Debug" or "Release" but you may have custom build configuration configured for your app.
type: string
default: "Debug"
derived_data_path:
description: The path to the directory to place the derived data, relative to the root of the repository.
type: string
default: "ios/build"
device:
description: The type of device you want to build for.
type: string
default: "iPhone X"
scheme:
description: The scheme to use.
type: string

steps:
- when:
condition: <<parameters.checkout>>
steps:
- checkout
- when:
condition: <<parameters.attach_workspace>>
steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- setup_macos_executor
- yarn_install
- when:
condition: <<parameters.start_metro>>
steps:
- metro_start
- ios_build:
project_path: <<parameters.project_path>>
derived_data_path: <<parameters.derived_data_path>>
device: <<parameters.device>>
build_configuration: <<parameters.build_configuration>>
scheme: <<parameters.scheme>>
project_type: <<parameters.project_type>>

0 comments on commit b607782

Please sign in to comment.