diff --git a/build-community.sh b/build-community.sh index 5616c79b28e8609b68792b32208ae30de551dcc7..1895b1c553f19c51d418f94d6fefc1f57a7d9df4 100755 --- a/build-community.sh +++ b/build-community.sh @@ -83,41 +83,37 @@ for branch in ${BRANCH_NAME//,/ }; do if [ -n "$branch" ] && [ -n "$devices" ]; then vendor=lineage - case "$branch" in - v*-nougat*) - vendor="cm" + regex_part1="^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(" + regex_part2=")(-[a-zA-Z0-9_]*)*$" + + if [[ "${BRANCH_NAME}" =~ $regex_part1"nougat"$regex_part2 ]]; then + vendor="cm" themuppets_branch="cm-14.1" android_version="7.1.2" - ;; - v*-oreo*) + use_openjdk_from_ubuntu=true + elif [[ "${BRANCH_NAME}" =~ $regex_part1"oreo"$regex_part2 ]]; then themuppets_branch="lineage-15.1" android_version="8.1" - ;; - v*-pie*) + use_openjdk_from_ubuntu=true + elif [[ "${BRANCH_NAME}" =~ $regex_part1"pie"$regex_part2 ]]; then themuppets_branch="lineage-16.0" android_version="9" - ;; - v*-q*) + elif [[ "${BRANCH_NAME}" =~ $regex_part1"q"$regex_part2 ]]; then themuppets_branch="lineage-17.1" android_version="10" - ;; - v*-r*) + elif [[ "${BRANCH_NAME}" =~ $regex_part1"r"$regex_part2 ]]; then themuppets_branch="lineage-18.1" android_version="11" - ;; - v*-s*) + elif [[ "${BRANCH_NAME}" =~ $regex_part1"s"$regex_part2 ]]; then themuppets_branch="lineage-19.1" android_version="12" - ;; - v*-t*) + elif [[ "${BRANCH_NAME}" =~ $regex_part1"t"$regex_part2 ]]; then themuppets_branch="lineage-20.0" android_version="13" - ;; - *) + else echo ">> [$(date)] Building branch $branch is not (yet) suppported" exit 1 - ;; - esac + fi android_version_major=$(cut -d '.' -f 1 <<< $android_version) diff --git a/src/build.sh b/src/build.sh index 92cd0538e967f8db0689ae6b122c2bcd0b6af086..7bb96bd588151c882466b47b1b899fa3a2fac458 100755 --- a/src/build.sh +++ b/src/build.sh @@ -38,44 +38,38 @@ branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0 branch_dir=${branch_dir^^} if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then - vendor=lineage - case "$BRANCH_NAME" in - v*-nougat*) + vendor=lineage + regex_part1="^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(" + regex_part2=")(-[a-zA-Z0-9_]*)*$" + + if [[ "${BRANCH_NAME}" =~ $regex_part1"nougat"$regex_part2 ]]; then vendor="cm" - themuppets_branch="cm-14.1" - android_version="7.1.2" - use_openjdk_from_ubuntu=true - ;; - v*-oreo*) - themuppets_branch="lineage-15.1" - android_version="8.1" - use_openjdk_from_ubuntu=true - ;; - v*-pie*) - themuppets_branch="lineage-16.0" - android_version="9" - ;; - v*-q*) - themuppets_branch="lineage-17.1" - android_version="10" - ;; - v*-r*) - themuppets_branch="lineage-18.1" - android_version="11" - ;; - v*-s*) - themuppets_branch="lineage-19.1" - android_version="12" - ;; - v*-t*) - themuppets_branch="lineage-20.0" - android_version="13" - ;; - *) - echo ">> [$(date)] Building branch $branch is not (yet) suppported" - exit 1 - ;; - esac + themuppets_branch="cm-14.1" + android_version="7.1.2" + use_openjdk_from_ubuntu=true + elif [[ "${BRANCH_NAME}" =~ $regex_part1"oreo"$regex_part2 ]]; then + themuppets_branch="lineage-15.1" + android_version="8.1" + use_openjdk_from_ubuntu=true + elif [[ "${BRANCH_NAME}" =~ $regex_part1"pie"$regex_part2 ]]; then + themuppets_branch="lineage-16.0" + android_version="9" + elif [[ "${BRANCH_NAME}" =~ $regex_part1"q"$regex_part2 ]]; then + themuppets_branch="lineage-17.1" + android_version="10" + elif [[ "${BRANCH_NAME}" =~ $regex_part1"r"$regex_part2 ]]; then + themuppets_branch="lineage-18.1" + android_version="11" + elif [[ "${BRANCH_NAME}" =~ $regex_part1"s"$regex_part2 ]]; then + themuppets_branch="lineage-19.1" + android_version="12" + elif [[ "${BRANCH_NAME}" =~ $regex_part1"t"$regex_part2 ]]; then + themuppets_branch="lineage-20.0" + android_version="13" + else + echo ">> [$(date)] Building branch $branch is not (yet) suppported" + exit 1 + fi android_version_major=$(cut -d '.' -f 1 <<< $android_version)