-
Notifications
You must be signed in to change notification settings - Fork 28
/
step.yml
263 lines (243 loc) · 10.6 KB
/
step.yml
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
title: Gradle Runner
summary: |-
Runs a specified Gradle task.
description: |-
The Step runs the specified Gradle task and copies the generated APK and AAB files into
the Bitrise Deploy Directory (`$BITRISE_DEPLOY_DIR`). It is capable of doing everything that you can do with Gradle on your own machine.
### Configuring the Step
To use this Step, you need at least two things:
* [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html).
* A Gradle task that is correctly configured in your Gradle project.
The Step can run the specified task with the Gradle Wrapper. For the basic configuration:
1. Open the **Config** input group.
1. In the **Gradle task to run** input, add the task you want to run. Without an existing, valid task, the Step will fail.
1. Set the `gradlew` file path: this is the path where the Gradle Wrapper lives in your project. The path should be relative to the project's root.
1. Optionally, you can set a `build.gradle` file for the Step in the **Optional path to the gradle build file to use** input.
To configure exporting an APK or AAB file generated by the Step:
1. Open the **Export config** input group.
1. Filter the files you want the Step to export. You can filter:
* APK and AAB files.
* Test APK files.
* Mapping files.
Both exclude and include filters can be used. Each filter option can take multiple patterns, with each pattern on its own line in the input field.
### Troubleshooting
If the Step keeps failing because it can't download the dependencies, check the `repositories` section in your `build.gradle` file.
It's possible that one or more of the services listed there are down so we Bitrise can't connect to them to download the dependencies you need.
If you use a `build.gradle` file and get the error `Issue with input: GradleFile does not exist`, check the **Optional path to the gradle build file to use** input.
Remember, the path must be relative to the root of the repository.
### Useful links
* [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html)
* [Caching Gradle](https://devcenter.bitrise.io/builds/caching/caching-gradle/)
### Related Steps
* [Generate Gradle Wrapper](https://www.bitrise.io/integrations/steps/generate-gradle-wrapper)
* [Gradle Unit Test](https://www.bitrise.io/integrations/steps/gradle-unit-test)
* [Android Build](https://www.bitrise.io/integrations/steps/android-build)
website: https://github.com/bitrise-io/steps-gradle-runner
source_code_url: https://github.com/bitrise-io/steps-gradle-runner
support_url: https://github.com/bitrise-io/steps-gradle-runner/issues
project_type_tags:
- android
- react-native
- cordova
- ionic
- flutter
type_tags:
- build
is_requires_admin_user: false
is_always_run: false
is_skippable: false
toolkit:
go:
package_name: github.com/bitrise-io/steps-gradle-runner
inputs:
- gradle_file: $GRADLE_BUILD_FILE_PATH
opts:
category: Config
title: Optional path to the Gradle build file to use
description: |
Optional path to the Gradle build file to use. It should be relative to the root of the project.
- gradle_task: assemble
opts:
category: Config
title: Gradle task to run
description: |
Gradle task to run.
You can call `gradle tasks` or `gradle tasks --all` in your
Gradle project directory to get the list of available tasks.
is_required: true
- gradlew_path: $GRADLEW_PATH
opts:
category: Config
title: gradlew file path
description: |
Using a Gradle Wrapper (gradlew) is required, as the wrapper ensures
that the right Gradle version is installed and used for the build.
You can find more information about the Gradle Wrapper (gradlew),
and about how you can generate one
in the official guide at: [https://docs.gradle.org/current/userguide/gradle_wrapper.html](https://docs.gradle.org/current/userguide/gradle_wrapper.html).
The path should be relative to the repository root. For example, `./gradlew`,
or if it is in a sub directory, `./sub/dir/gradlew`.
is_required: true
- app_file_include_filter: |
*.apk
*.aab
opts:
category: Export Config
title: APK and AAB file include filter
description: |
The Step will copy the generated APK and AAB files that match this filter into the Bitrise deploy directory.
Seperate patterns with a newline.
Example:
Copy every APK and AAB file:
```
*.apk
*.aab
```
Copy every APK file with a filename that contains `release`, like (`./app/build/outputs/apk/app-release-unsigned.apk`):
```
*release*.apk
```
- app_file_exclude_filter: |
*unaligned.apk
*Test*.apk
*/intermediates/*
opts:
category: Export Config
title: APK and AAB file exclude filter
description: |
One filter per line. The Step will NOT copy the generated APK and AAB files that match these filters into the Bitrise deploy directory.
You can use this filter to avoid moving unaligned and/or unsigned APK and AAB files.
If you specify an empty filter, every APK and AAB file (selected by `APK and AAB file include filter`) will be copied.
Seperate patterns with a newline.
Examples:
Do not copy APK files with a filename that contains `unaligned`:
```
*unaligned*.apk
```
Do not copy APK files with a filename that contains `unaligned` and/or `Test`:
```
*unaligned*.apk
*Test*.apk
```
- test_apk_file_include_filter: "*Test*.apk"
opts:
category: Export Config
title: Test APK file include filter
description: |
The Step will copy the generated apk files that match this filter into the Bitrise deploy directory.
Example:
Copy every APK if its filename contains Test, like (./app/build/outputs/apk/app-debug-androidTest-unaligned.apk):
```
*Test*.apk
```
- test_apk_file_exclude_filter: ""
opts:
category: Export Config
title: Test APK file exclude filter
description: |
One filter per line. The Step will NOT copy the generated apk files that match this filters into the Bitrise deploy directory.
You can use this filter to avoid moving unalinged and/or unsigned apk files.
If you specify an empty filter, every APK file (selected by `apk_file_include_filter`) will be copied.
Example:
Do not copy the test APK file if its filename contains `unaligned`:
```
*unaligned*.apk
```
- mapping_file_include_filter: "*/mapping.txt"
opts:
category: Export Config
title: Mapping file include filter
description: |
The Step will copy the generated mapping files that match this filter into the Bitrise deploy directory.
If you specify an empty filter, no mapping files will be copied.
Example:
Copy every mapping.txt file:
```
*mapping.txt
```
- mapping_file_exclude_filter: "*/tmp/*"
opts:
category: Export Config
title: Mapping file exclude filter
description: |
The Step will **not** copy the generated mapping files that match this filter into the Bitrise deploy directory.
You can use this input to avoid moving a beta mapping file, for example.
If you specify an empty filter, every mapping file (selected by `mapping_file_include_filter`) will be copied.
Example:
Do not copy any mapping.txt file that is in a `beta` directoy:
```
*/beta/mapping.txt
```
- cache_level: only_deps
opts:
category: Debug
title: Set the level of cache
description: |-
`all` - will cache build-cache and dependencies
`only_deps` - will cache dependencies only
`none` - won't cache any of the above
is_required: true
value_options:
- all
- only_deps
- none
- gradle_options: --stacktrace
opts:
category: Debug
title: Additional flags for Gradle
description: |-
Flags added to the end of the Gradle call.
You can use multiple options, separated by a space. Example: `--stacktrace --debug`
If `--debug` or `-d` options are set then only the last 20 lines of the raw gradle output will be visible in the build log.
The full raw output will be exported to the `$BITRISE_GRADLE_RAW_RESULT_TEXT_PATH` variable and will be added as a build artifact.
outputs:
- BITRISE_APK_PATH:
opts:
title: Path of the generated APK
summary: Path of the generated (and copied) APK file - after filtering.
description: |-
This output will include the path of the generated APK file,
after filtering based on the filter inputs.
If the build generates more than one APK file which fulfills the
filter inputs this output will contain the last one's path.
- BITRISE_AAB_PATH:
opts:
title: Path of the generated AAB
summary: Path of the generated (and copied) AAB file - after filtering.
description: |-
This output will include the path of the generated AAB file,
after filtering based on the filter inputs.
If the build generates more than one AAB file which fulfills the
filter inputs this output will contain the last one's path.
- BITRISE_TEST_APK_PATH:
opts:
title: Path of the generated test APK file
summary: Path of the generated (and copied) test APK file - after filtering.
description: |-
This output will include the path of the generated test APK file,
after filtering based on the filter inputs.
If the build generates more than one APK file which fulfills the
filter inputs this output will contain the last one's path.
- BITRISE_APK_PATH_LIST:
opts:
title: List of the generated APK file paths
summary: List of the generated (and copied) APK file paths - after filtering.
description: |-
This output will include the paths of the generated APK files,
after filtering based on the filter inputs.
The paths are separated with `|` character, eg: `app-armeabi-v7a-debug.apk|app-mips-debug.apk|app-x86-debug.apk`
- BITRISE_AAB_PATH_LIST:
opts:
title: List of the generated AAB file paths
summary: List of the generated (and copied) AAB file paths - after filtering.
description: |-
This output will include the paths of the generated AAB files,
after filtering based on the filter inputs.
The paths are separated with `|` character, eg: `app.aab|app2.aab`
- BITRISE_MAPPING_PATH:
opts:
title: Path of the generated mapping.txt
summary: Path of the generated (and copied) mapping.txt.
description: |-
This output will include the path of the generated mapping.txt.
If more than one mapping.txt exist in project this output will contain the last one's path.