Builds your Android project with Gradle with the belonging AndroidTest variant.
Description
This Step generates all the APKs you need to run instrumentation tests for your Android app: both an APK from your app and the belonging test APK, for example, :app:assembleDemoDebug
, :app:assembleDemoDebugAndroidTest
- Add the Project Location which is the root directory of your Android project.
- Set the Module you want to build. To see your available modules, open your project in Android Studio and go to Project Structure and see the list on the left.
- Set the Variant you want to build. To see your available variants, open your project in Android Studio and go to Project Structure and then the variants section. Under Options:
- Set the APK location pattern: Once the build has run, the Step finds the APK files with the given pattern.
- Set the level of cache where
all
caches build cache and dependencies,only_deps
caches dependencies only,none
does not cache anything. - If you wish to pass any extra Gradle arguments to the gradle task, you can add those in the Additional Gradle Arguments input.
Add this step directly to your workflow in the Bitrise Workflow Editor.
You can also run this step directly with Bitrise CLI.
Inputs
Key | Description | Flags | Default |
---|---|---|---|
project_location |
The root directory of your android project, for example, where your root build gradle file exist (also gradlew, settings.gradle, etc...) | required | $BITRISE_SOURCE_DIR |
module |
Set the module to build. Valid syntax examples: app , feature:nested-module To see your available modules please open your project in Android Studio and go in [Project Structure] and see the list on the left. |
required | |
variant |
Set the variant that you want to build. To see your available variants please open your project in Android Studio and go in [Project Structure] -> variants section. | required | |
apk_path_pattern |
Will find the APK files with the given pattern. | required | */build/outputs/apk/*.apk |
cache_level |
all - will cache build cache and dependencies only_deps - will cache dependencies only none - will not cache anything |
required | only_deps |
arguments |
Extra arguments passed to the gradle task |
Outputs
Environment Variable | Description |
---|---|
BITRISE_APK_PATH |
This output will include the path of the generated APK after filtering based on the filter inputs. |
BITRISE_TEST_APK_PATH |
This output will include the path of the generated test APK after filtering based on the filter inputs. |
We welcome pull requests and issues against this repository.
For pull requests, work on your changes in a forked repository and use the Bitrise CLI to run step tests locally.
Learn more about developing steps: