-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathandroid_build.yml
More file actions
108 lines (105 loc) · 4.03 KB
/
android_build.yml
File metadata and controls
108 lines (105 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
description: Builds the Android app at the given path with the given build types.
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: .
persist_to_workspace:
description: Should this job persist files to a workspace? Defaults to true
type: boolean
default: true
store_artifacts:
description: Store this job store files as job artifacts? Defaults to true
type: boolean
default: true
yarn_cache:
description: Should we cache after yarn install? Defaults to true
type: boolean
default: true
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""
# For the build command
project_path:
description: The path to the root of the Android project you want to build, relative to the root of the repository.
type: string
default: "./android"
build_type:
description: The build type to build. This is normally either "debug" or "release" but you may have custom build types configured for your app.
type: string
default: "debug"
test_build_type:
description: The test build type to build. This is normally either "debug" or "release" but you may have custom build types configured for your app.
type: string
default: "debug"
build_cache:
description: Should we cache after Gradle build? Defaults to true
type: boolean
default: true
assemble_android_test:
description: Configure the android tests to run. Defaults to assembleAndroidTest
type: string
default: assembleAndroidTest
gradle_options:
description: Gradle command options. Note that setting this will override the default options so you might need to supply those as well.
type: string
default: '-Xmx2014m -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+UnlockExperimentalVMOptions -XX:+HeapDumpOnOutOfMemoryError"'
build_image_version:
description: React Native Android build image version. For available veresions, see https://hub.docker.com/r/reactnativecommunity/react-native-android/tags
type: string
default: '5.1'
resource_class:
description: Changes the resource class of the executor. Requires a support request to enable the resource_class parameter. See https://circleci.com/docs/2.0/configuration-reference/#resource_class
type: string
default: medium
executor:
name: linux_android
gradle_options: <<parameters.gradle_options>>
build_image_version: <<parameters.build_image_version>>
resource_class: <<parameters.resource_class>>
steps:
- when:
condition: <<parameters.checkout>>
steps:
- checkout
- when:
condition: <<parameters.attach_workspace>>
steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- yarn_install:
cache: <<parameters.yarn_cache>>
- when:
condition: <<parameters.on_after_initialize>>
steps:
- run:
name: "on_after_initialize"
command: <<parameters.on_after_initialize>>
- android_build:
project_path: <<parameters.project_path>>
build_type: <<parameters.build_type>>
test_build_type: <<parameters.test_build_type>>
cache: <<parameters.build_cache>>
assemble_android_test: <<parameters.assemble_android_test>>
- when:
condition: <<parameters.persist_to_workspace>>
steps:
- persist_to_workspace:
root: .
paths:
- <<parameters.project_path>>/app/build/outputs/apk
- when:
condition: <<parameters.store_artifacts>>
steps:
- store_artifacts:
path: <<parameters.project_path>>/app/build/outputs/apk