Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30ae1f95 authored by Sahil Sonar's avatar Sahil Sonar 💬 Committed by Mohammed Althaf T
Browse files

docker: Add support for android 14



  - Android 14 introduced a new lunch format
    <product>-<release>-<variant>.
  - Add support to handle release case

Co-authored-by: default avatarMohammed Althaf Thayyil <althafvly@gmail.com>
parent ea5ed4eb
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -114,6 +114,9 @@ for branch in ${BRANCH_NAME//,/ }; do
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"t"$regex_part2 ]]; then
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"t"$regex_part2 ]]; then
      themuppets_branch="lineage-20.0"
      themuppets_branch="lineage-20.0"
      android_version="13"
      android_version="13"
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"u"$regex_part2 ]]; then
      themuppets_branch="lineage-21.0"
      android_version="14"
    else
    else
      echo ">> [$(date)] Building branch $branch is not (yet) suppported"
      echo ">> [$(date)] Building branch $branch is not (yet) suppported"
      exit 1
      exit 1
@@ -326,13 +329,14 @@ for branch in ${BRANCH_NAME//,/ }; do
        fi
        fi


        BRUNCH_DEVICE=${codename}
        BRUNCH_DEVICE=${codename}
        BUILD_TYPE=userdebug


        if [ "${ENG_BUILD}" = true ]; then
        if [ "${ENG_BUILD}" = true ]; then
          BRUNCH_DEVICE=lineage_${codename}-eng
          BUILD_TYPE=eng
        fi
        fi


        if [ "$android_version_major" -lt "12" ]; then
        if [ "$android_version_major" -lt "12" ]; then
          if brunch ${BRUNCH_DEVICE} &>>"$DEBUG_LOG"; then
          if brunch ${BRUNCH_DEVICE} ${BUILD_TYPE} &>>"$DEBUG_LOG"; then
            currentdate=$(date +%Y%m%d)
            currentdate=$(date +%Y%m%d)
            if [ "$builddate" != "$currentdate" ]; then
            if [ "$builddate" != "$currentdate" ]; then
              find out/target/product/$codename -maxdepth 1 -name "e-*-$currentdate-*.zip*" -type f -exec sh /root/fix_build_date.sh {} $currentdate $builddate \; &>>"$DEBUG_LOG"
              find out/target/product/$codename -maxdepth 1 -name "e-*-$currentdate-*.zip*" -type f -exec sh /root/fix_build_date.sh {} $currentdate $builddate \; &>>"$DEBUG_LOG"
@@ -350,7 +354,7 @@ for branch in ${BRANCH_NAME//,/ }; do
          else
          else
            echo ">> [$(date)] Failed build for $codename" | tee -a "$DEBUG_LOG"
            echo ">> [$(date)] Failed build for $codename" | tee -a "$DEBUG_LOG"
          fi
          fi
        elif breakfast ${BRUNCH_DEVICE} &>>"$DEBUG_LOG"; then
        elif breakfast ${BRUNCH_DEVICE} ${BUILD_TYPE} &>>"$DEBUG_LOG"; then
          mka target-files-package otatools
          mka target-files-package otatools
          echo ">> [$(date)] Starting signing target-files-package"
          echo ">> [$(date)] Starting signing target-files-package"


+22 −11
Original line number Original line Diff line number Diff line
@@ -91,7 +91,7 @@ exit_script() {
sync_successful=true
sync_successful=true


use_openjdk_from_ubuntu=false
use_openjdk_from_ubuntu=false
branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(nougat|oreo|pie|q|r|s|t)(-[a-zA-Z0-9_]*)*$/\5/' <<<"${BRANCH_NAME}")
branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(nougat|oreo|pie|q|r|s|t|u)(-[a-zA-Z0-9_]*)*$/\5/' <<<"${BRANCH_NAME}")
branch_dir=${branch_dir^^}
branch_dir=${branch_dir^^}


if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then
if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then
@@ -122,6 +122,9 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then
  elif [[ "${BRANCH_NAME}" =~ $regex_part1"t"$regex_part2 ]]; then
  elif [[ "${BRANCH_NAME}" =~ $regex_part1"t"$regex_part2 ]]; then
    themuppets_branch="lineage-20.0"
    themuppets_branch="lineage-20.0"
    android_version="13"
    android_version="13"
  elif [[ "${BRANCH_NAME}" =~ $regex_part1"u"$regex_part2 ]]; then
    themuppets_branch="lineage-21.0"
    android_version="14"
  else
  else
    echo ">> [$(date)] Building branch $branch is not (yet) suppported"
    echo ">> [$(date)] Building branch $branch is not (yet) suppported"
    exit 1
    exit 1
@@ -314,16 +317,16 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then
    build_successful=false
    build_successful=false
    echo ">> [$(date)] ANDROID_JACK_VM_ARGS=${ANDROID_JACK_VM_ARGS}"
    echo ">> [$(date)] ANDROID_JACK_VM_ARGS=${ANDROID_JACK_VM_ARGS}"


    BRUNCH_DEVICE=${DEVICE}
    BUILD_TYPE=userdebug


    if [ "${ENG_BUILD}" = true ]; then
    if [ "${ENG_BUILD}" = true ]; then
      BRUNCH_DEVICE=lineage_${DEVICE}-eng
      BUILD_TYPE=eng
    elif [ "${USER_BUILD}" = true ]; then
    elif [ "${USER_BUILD}" = true ]; then
      BRUNCH_DEVICE=lineage_${DEVICE}-user
      BUILD_TYPE=user
    elif [ "${IS_EMULATOR}" = true ]; then
      BRUNCH_DEVICE=lineage_${DEVICE}-userdebug
    fi
    fi


    BRUNCH_DEVICE=lineage_${DEVICE}-${BUILD_TYPE}

    if [[ "${BRANCH_NAME}" = *"rc"* ]] || [[ "${BRANCH_NAME}" = *"alpha"* ]] || [[ "${BRANCH_NAME}" == *"beta"* ]]; then
    if [[ "${BRANCH_NAME}" = *"rc"* ]] || [[ "${BRANCH_NAME}" = *"alpha"* ]] || [[ "${BRANCH_NAME}" == *"beta"* ]]; then
      PRODUCT_PRERELEASE=$(echo ${BRANCH_NAME} | sed -E 's/v[0-9]*\.[0-9]*(\.[0-9]*)?-(beta|alpha|rc).*/\2/')
      PRODUCT_PRERELEASE=$(echo ${BRANCH_NAME} | sed -E 's/v[0-9]*\.[0-9]*(\.[0-9]*)?-(beta|alpha|rc).*/\2/')
      export PRODUCT_PRERELEASE
      export PRODUCT_PRERELEASE
@@ -334,24 +337,32 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then
    fi
    fi


    build_success=false
    build_success=false
    if [ "${BUILD_ONLY_SYSTEMIMAGE}" = true ]; then
    breakfast_device() {
      if [ "$android_version_major" -gt "13" ]; then
        breakfast "${DEVICE}" "${BUILD_TYPE}"
      else
        breakfast "${BRUNCH_DEVICE}"
        breakfast "${BRUNCH_DEVICE}"
      fi
    }

    if [ "${BUILD_ONLY_SYSTEMIMAGE}" = true ]; then
      breakfast_device
      if make systemimage; then
      if make systemimage; then
        build_success=true
        build_success=true
      fi
      fi
    elif [ "${IS_EMULATOR}" = true ]; then
    elif [ "${IS_EMULATOR}" = true ]; then
      if lunch "${BRUNCH_DEVICE}" && mka sdk_addon; then
      if breakfast_device && mka && mka sdk_addon; then
        build_success=true
        build_success=true
      fi
      fi
    elif [ "$android_version_major" -lt "12" ]; then
    elif [ "$android_version_major" -lt "12" ]; then
      if [ "${BUILD_SUPER_IMAGE}" = true ]; then
      if [ "${BUILD_SUPER_IMAGE}" = true ]; then
        if breakfast "${BRUNCH_DEVICE}" && mka bacon superimage; then
        if breakfast_device && mka bacon superimage; then
          build_success=true
          build_success=true
        fi
        fi
      elif brunch "${BRUNCH_DEVICE}"; then
      elif brunch "${DEVICE}" "${BUILD_TYPE}"; then
        build_success=true
        build_success=true
      fi
      fi
    elif breakfast "${BRUNCH_DEVICE}"; then
    elif breakfast_device; then
      # Apply patch for vendor prebuilt devices.
      # Apply patch for vendor prebuilt devices.
      if [ "${DEVICE}" = "one" ] || [ "${DEVICE}" = "two" ]; then
      if [ "${DEVICE}" = "one" ] || [ "${DEVICE}" = "two" ]; then
        echo ">> [$(date)] Applying patch for prebuilt vendor device"
        echo ">> [$(date)] Applying patch for prebuilt vendor device"