blob: 52fb12ec952e1c4a8f4967b8a5624ddb7ca65322 [file] [log] [blame]
Jeff Gaston8c4ff1d2019-09-24 14:49:51 -04001#!/bin/bash
2set -e
3
Jeff Gaston868c5022020-06-16 17:32:18 -04004echo "Starting $0 at $(date)"
5
Jeff Gaston668fb362020-01-10 18:20:48 -05006cd "$(dirname $0)"
Jeff Gaston8c4ff1d2019-09-24 14:49:51 -04007
Jeff Gastona80a3f62022-05-10 14:35:53 -04008# This target is for testing that clean builds work correctly
9# We disable the remote cache for this target unless it was already enabled
Jeff Gaston01b5fb02022-05-12 11:48:13 -040010if [ "$USE_ANDROIDX_REMOTE_BUILD_CACHE" == "" ]; then
Jeff Gastona80a3f62022-05-10 14:35:53 -040011 export USE_ANDROIDX_REMOTE_BUILD_CACHE=false
12fi
Jeff Gastonb609d632022-05-09 11:57:23 -040013
Jeff Gaston4dff6e1c2021-04-15 11:24:37 -040014EXIT_VALUE=0
Jeff Gaston46676e32020-01-15 16:28:34 -050015
Alan Viverettefc333552021-11-18 17:07:04 -050016# Validate translation exports, if present
17if ! impl/check_translations.sh; then
18 EXIT_VALUE=1
19else
20 # Run Gradle
Jeff Gastone92d4d32022-09-19 12:35:15 -040021 if ! impl/build.sh buildOnServer checkExternalLicenses listTaskOutputs \
Alan Viverettefc333552021-11-18 17:07:04 -050022 -Pandroidx.enableComposeCompilerMetrics=true \
23 -Pandroidx.enableComposeCompilerReports=true \
Aurimas Liutikasf06703b2022-07-08 16:28:11 +000024 --no-daemon \
Alan Viverettefc333552021-11-18 17:07:04 -050025 --profile "$@"; then
26 EXIT_VALUE=1
27 fi
28
29 # Parse performance profile reports (generated with the --profile option above) and re-export
30 # the metrics in an easily machine-readable format for tracking
31 impl/parse_profile_htmls.sh
32fi
Jeff Gaston868c5022020-06-16 17:32:18 -040033
Jeff Gaston4dff6e1c2021-04-15 11:24:37 -040034echo "Completing $0 at $(date) with exit value $EXIT_VALUE"
35
36exit "$EXIT_VALUE"