Skip to content

Commit c6cb3a6

Browse files
committed
Add usage descriptions
1 parent fda31cf commit c6cb3a6

File tree

5 files changed

+47
-16
lines changed

5 files changed

+47
-16
lines changed

src/commands/android_build.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
description: Builds the Android app at the given path with the given build types. This should be run only after installing dependencies.
2+
13
parameters:
24
project_path:
5+
description: The path to the root of the Android project you want to build, relative to the root of the repository.
36
type: string
47
default: "./android"
5-
app_build_type:
6-
type: enum
7-
enum: ["Debug", "Release"]
8-
default: "Debug"
9-
test_build_type:
10-
type: enum
11-
enum: ["debug", "release"]
8+
build_type:
9+
description: The build type to build. This is normally either "debug" or "release" but you may have custom build types configured for your app.
10+
type: string
1211
default: "debug"
1312

1413
steps:
@@ -18,18 +17,23 @@ steps:
1817
mkdir -p ~/.tmp/checksumfiles
1918
find . -type f -name 'build.gradle' -not -path "*node_modules*" -exec cat {} + >> ~/.tmp/checksumfiles/build.gradle
2019
find . -type f -name 'settings.gradle' -not -path "*node_modules*" -exec cat {} + >> ~/.tmp/checksumfiles/settings.gradle
20+
2121
- restore_cache:
22-
key: |
23-
gradle-wrapper-{{ arch }}-{{ checksum "<<parameters.project_path>>/gradle/wrapper/gradle-wrapper.properties" }}-{{ .Environment.CACHE_VERSION }}
22+
keys:
23+
- gradle-wrapper-{{ arch }}-{{ checksum "<<parameters.project_path>>/gradle/wrapper/gradle-wrapper.properties" }}-{{ .Environment.CACHE_VERSION }}
24+
- gradle-wrapper
25+
2426
- restore_cache:
2527
keys:
2628
- gradle-home-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/build.gradle" }}-{{ checksum "~/.tmp/checksumfiles/settings.gradle" }}-{{ .Environment.CACHE_VERSION }}
2729
- gradle-home-cache
30+
2831
- restore_cache:
2932
name: Restoring Gradle Build caches
3033
keys:
3134
- gradle-build-cache-{{ .Revision }}
3235
- gradle-build-cache
36+
3337
- run:
3438
name: Dispersing Gradle Build caches for restoring
3539
command: |
@@ -38,23 +42,28 @@ steps:
3842
rm -rf ~/.gradle/caches/build-cache-* &&
3943
mkdir -p ~/.gradle/caches/ &&
4044
mv ~/gradle-build-caches/* ~/.gradle/caches/ || true
45+
4146
# download and cache dependencies and Gradle
4247
- run:
4348
name: Downloading Gradle Dependencies
4449
command: "cd <<parameters.project_path>> && ./gradlew --max-workers 2 downloadDependencies"
50+
4551
- save_cache:
4652
name: Saving Gradle wrapper cache
4753
paths:
4854
- ~/.gradle/wrapper/
4955
key: gradle-wrapper-{{ checksum "<<parameters.project_path>>/gradle/wrapper/gradle-wrapper.properties" }}
56+
5057
- save_cache:
5158
name: Saving Gradle home cache
5259
paths:
5360
- ~/.gradle/caches/
5461
key: gradle-home-cache-{{ checksum "~/.tmp/checksumfiles/build.gradle" }}-{{ checksum "~/.tmp/checksumfiles/settings.gradle" }}
62+
5563
- run:
5664
name: Build Android Debug APK
57-
command: "cd <<parameters.project_path>> && chmod +x gradlew && ./gradlew --build-cache --max-workers 2 --continue assemble<<parameters.app_build_type>> assembleAndroidTest -DtestBuildType=<<parameters.test_build_type>> --stacktrace"
65+
command: "cd <<parameters.project_path>> && chmod +x gradlew && ./gradlew --build-cache --max-workers 2 --continue assemble<<parameters.build_type>> assembleAndroidTest -DtestBuildType=<<parameters.build_type>> --stacktrace"
66+
5867
- run:
5968
name: Collecting Gradle Build caches for saving
6069
command: |
@@ -64,6 +73,7 @@ steps:
6473
rm -rf ~/gradle-build-caches/* &&
6574
mv ~/.gradle/caches/build-cache-* ~/gradle-build-caches || true
6675
when: always
76+
6777
- save_cache:
6878
name: Saving Gradle Build caches
6979
paths:

src/commands/android_emulator_start.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1+
description: Installs and starts an Android emulator with the given version and name.
2+
13
parameters:
4+
device_name:
5+
description: The name of the AVD. You use this name to tell which device to run tests on.
6+
type: string
7+
default: "TestingAVD"
28
platform_version:
9+
description: The version of android to run on the emulator. Usually in the form of "android-28".
310
type: string
411
default: "android-28"
512
build_tools_version:
13+
description: The version of the Android build tools to install.
614
type: string
715
default: "28.0.3"
16+
logcat_grep:
17+
description: ADB logs will be shown in the "Start Android Emulator" commands, but we filter it using grep to avoid noise. You can specify additional strigns to grep for. Make sure you escape special characters.
18+
type: string
19+
default: "com.reactnativecommunity"
820

921
steps:
1022
- run:
@@ -29,13 +41,13 @@ steps:
2941
3042
- run:
3143
name: Create Android Emulator
32-
command: avdmanager create avd --force -n TestingAVD -k "system-images;<<parameters.platform_version>>;google_apis;x86" -g google_apis -d "Nexus 4"
44+
command: avdmanager create avd --force -n <<parameters.device_name>> -k "system-images;<<parameters.platform_version>>;google_apis;x86" -g google_apis -d "Nexus 4"
3345

3446
- run:
3547
name: Start Android Emulator in background
3648
command: |
37-
/usr/local/share/android-sdk/emulator/emulator @TestingAVD -version
38-
/usr/local/share/android-sdk/emulator/emulator @TestingAVD -skin 470x860 -cores 1 -gpu auto -accel on -memory 1024 -no-audio -no-snapshot -no-boot-anim -no-window -logcat *:W | grep -i 'ReactNative\|com.reactnativecommunity\|RNCNetInfo'
49+
/usr/local/share/android-sdk/emulator/emulator @<<parameters.device_name>> -version
50+
/usr/local/share/android-sdk/emulator/emulator @<<parameters.device_name>> -skin 470x860 -cores 1 -gpu auto -accel on -memory 1024 -no-audio -no-snapshot -no-boot-anim -no-window -logcat *:W | grep -i 'ReactNative\|<<parameters.logcat_grep>>'
3951
background: true
4052

4153
- run:

src/commands/ios_simulator_start.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
description: Starts an iOS simulator with the given name.
2+
13
parameters:
24
device:
5+
description: The type of device you want to start.
36
type: string
47
default: "iPhone X"
58

src/commands/setup_macos_executor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
description: Installs the required packages to build and test Android and iOS applications on the MacOS executor. You need to run this before running any other command on those executors.
2+
13
steps:
24
- run:
35
name: Configure Environment Variables

src/commands/yarn_install.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1+
description: Install Javascript dependencies using Yarn. This command correctly configures the cache for any number of package.json and yarn.lock files.
2+
13
steps:
24
- run:
35
name: Create cache checksum file
46
command: |
57
mkdir -p ~/.tmp/checksumfiles
68
find . -type f -name 'package.json' -not -path "*node_modules*" -exec cat {} + >> ~/.tmp/checksumfiles/package.json
9+
find . -type f -name 'yarn.lock' -not -path "*node_modules*" -exec cat {} + >> ~/.tmp/checksumfiles/yarn.lock
710
- restore_cache:
8-
key: |
9-
yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json" }}-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
11+
keys:
12+
- yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json" }}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
13+
- yarn-cache
1014
- run:
1115
name: Yarn Install
1216
command: yarn install --non-interactive --cache-folder ~/.cache/yarn
1317
- save_cache:
1418
paths:
1519
- ~/.cache/yarn
1620
key: |
17-
yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json" }}-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
21+
yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json" }}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{ .Environment.CACHE_VERSION }}

0 commit comments

Comments
 (0)