Skip to content

Commit b607782

Browse files
roni-castromatt-oakes
authored andcommitted
feat(ios): Added an ios_build job (#30 by @roni-castro)
1 parent 6ef6cf8 commit b607782

File tree

4 files changed

+101
-0
lines changed

4 files changed

+101
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ workflows:
113113
requires:
114114
- build_android_release
115115

116+
117+
# Build the iOS app in release mode and do not run tests
118+
- rn/ios_build:
119+
name: build_ios_release
120+
project_path: ios/Example.xcodeproj
121+
device: "iPhone X"
122+
build_configuration: Release
123+
scheme: Example
124+
requires:
125+
- analyse_js
126+
116127
# Build and test the iOS app in release mode
117128
- rn/ios_build_and_test:
118129
project_path: "ios/Example.xcodeproj"

src/examples/full.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ usage:
8484
requires:
8585
- build_android_release
8686

87+
# Build the iOS app in release mode and do not run tests
88+
- rn/ios_build:
89+
name: build_ios_release
90+
project_path: ios/Example.xcodeproj
91+
device: "iPhone X"
92+
build_configuration: Release
93+
scheme: Example
94+
requires:
95+
- analyse_js
96+
8797
# Build and test the iOS app in release mode
8898
- rn/ios_build_and_test:
8999
project_path: "ios/Example.xcodeproj"

src/examples/ios.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ usage:
5858
requires:
5959
- checkout_code
6060

61+
# Build the iOS app in release mode and do not run tests
62+
- rn/ios_build:
63+
name: build_ios_release
64+
project_path: ios/Example.xcodeproj
65+
device: "iPhone X"
66+
build_configuration: Release
67+
scheme: Example
68+
requires:
69+
- analyse_js
70+
6171
# Build and test the iOS app in release mode
6272
- rn/ios_build_and_test:
6373
project_path: "ios/Example.xcodeproj"

src/jobs/ios_build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
description: Builds the iOS app at the given path with the given build scheme
2+
3+
executor: macos
4+
5+
parameters:
6+
# For this job
7+
checkout:
8+
description: Boolean for whether or not to checkout as a first step. Default is false.
9+
type: boolean
10+
default: false
11+
attach_workspace:
12+
description: Boolean for whether or not to attach to an existing workspace. Default is true.
13+
type: boolean
14+
default: true
15+
workspace_root:
16+
description: Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory).
17+
type: string
18+
default: .
19+
start_metro:
20+
description: If we should start the Metro packager in the background for this job.
21+
type: boolean
22+
default: false
23+
# For the iOS build command
24+
project_type:
25+
description: If the iOS app is built using a project file (*.xcodeproj) or a workspace.
26+
type: enum
27+
enum: ["project", "workspace"]
28+
default: "project"
29+
project_path:
30+
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.
31+
type: string
32+
build_configuration:
33+
description: The build configuration to use. This is normally either "Debug" or "Release" but you may have custom build configuration configured for your app.
34+
type: string
35+
default: "Debug"
36+
derived_data_path:
37+
description: The path to the directory to place the derived data, relative to the root of the repository.
38+
type: string
39+
default: "ios/build"
40+
device:
41+
description: The type of device you want to build for.
42+
type: string
43+
default: "iPhone X"
44+
scheme:
45+
description: The scheme to use.
46+
type: string
47+
48+
steps:
49+
- when:
50+
condition: <<parameters.checkout>>
51+
steps:
52+
- checkout
53+
- when:
54+
condition: <<parameters.attach_workspace>>
55+
steps:
56+
- attach_workspace:
57+
at: <<parameters.workspace_root>>
58+
- setup_macos_executor
59+
- yarn_install
60+
- when:
61+
condition: <<parameters.start_metro>>
62+
steps:
63+
- metro_start
64+
- ios_build:
65+
project_path: <<parameters.project_path>>
66+
derived_data_path: <<parameters.derived_data_path>>
67+
device: <<parameters.device>>
68+
build_configuration: <<parameters.build_configuration>>
69+
scheme: <<parameters.scheme>>
70+
project_type: <<parameters.project_type>>

0 commit comments

Comments
 (0)