diff --git a/Dockerfile b/Dockerfile index eed5b20e199e14a5780ace8ff169ea3a8a330194..28c92dd7bf97d2e51478ab7d18f6470d64471999 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,6 +102,12 @@ ENV ENG_BUILD false #Save intermediate system.img even when not in out folder ENV BACKUP_INTERMEDIATE_SYSTEM_IMG false +# Backup emulator files +ENV BACKUP_EMULATOR false + +# Use lunch command (by default, it's brunch) +ENV USE_LUNCH false + # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts: # * begin.sh, run at the very beginning diff --git a/src/build.sh b/src/build.sh index e494fafa01145224011f37236f91d0ed8e647b64..b9add0c8e191c5fe3e7b0a2dcf30346244afd706 100755 --- a/src/build.sh +++ b/src/build.sh @@ -211,10 +211,12 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if make systemimage; then build_success=true fi - else - if brunch "${BRUNCH_DEVICE}"; then + elif [ "${USE_LUNCH}" = true ]; then + if lunch "${BRUNCH_DEVICE}" && mka && mka sdk_addon ; then build_success=true fi + elif brunch "${BRUNCH_DEVICE}"; then + build_success=true fi if [ "$build_success" = true ]; then @@ -226,7 +228,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then # Move produced ZIP files to the main OUT directory echo ">> [$(date)] Moving build artifacts for ${DEVICE} to '$ZIP_DIR/$zipsubdir'" cd "${OUT}" || return 1 - for build in e-*.zip; do + for build in $(ls e-*.zip); do #with only systemimage, we don't have a e-*.zip if [ "${BUILD_ONLY_SYSTEMIMAGE}" = true ]; then build=e-`grep lineage.version system/build.prop | sed s/#.*// | sed s/.*=// | tr -d \\n`.zip @@ -265,6 +267,14 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi done + if [ "$IS_EMULATOR" = true -a "$BACKUP_EMULATOR" = true ]; then + EMULATOR_ARCHIVE="e-android$android_version-eng-$currentdate-linux-x86-img.zip" + mv ../../../host/linux-x86/sdk_addon/*-img.zip "$ZIP_DIR/$zipsubdir/$EMULATOR_ARCHIVE" + pushd "$ZIP_DIR/$zipsubdir" + sha256sum "$EMULATOR_ARCHIVE" > "$EMULATOR_ARCHIVE.sha256sum" + popd + fi + cd "$source_dir" || return 1 build_successful=true else