Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 22 additions & 28 deletions src/usr/local/buildpack/tools/v2/flutter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,31 @@ function prepare_tool() {
function install_tool () {
local versioned_tool_path

local FLUTTER_SDK_CHANNEL="stable"
local FLUTTER_SDK_URL="https://storage.googleapis.com/flutter_infra_release/releases/${FLUTTER_SDK_CHANNEL}/linux/flutter_linux_${TOOL_VERSION}-${FLUTTER_SDK_CHANNEL}.tar.xz"
local file

if [[ $MAJOR -lt 1 || ($MAJOR -eq 1 && $MINOR -lt 17) ]]; then
echo "flutter < 1.17.0 is not supported: ${MAJOR}.${MINOR}" >&2
exit 1
fi

file=$(get_from_url "$FLUTTER_SDK_URL")

versioned_tool_path=$(create_versioned_tool_path)
tar -C "${versioned_tool_path}" --strip 1 -xf "${file}"

if [ "$MAJOR" -eq 1 ]; then

# git unsafe directory
if [[ $(is_root) -eq 0 ]]; then
git config --system --add safe.directory "${versioned_tool_path}"
else
git config --global --add safe.directory "${versioned_tool_path}"
fi

# fix rights
chmod -R g+w "${versioned_tool_path}"

# download dart sdk and init flutter
"${versioned_tool_path}/bin/flutter" --version
# fix rights
chmod -R g+w "${versioned_tool_path}"
git clone \
--quiet \
-c advice.detachedHead=false \
--depth 1 \
--filter=blob:none \
--branch "${TOOL_VERSION}" \
https://github.com/flutter/flutter.git \
"${versioned_tool_path}"

# download dart sdk and init flutter (too heavy)
#"${versioned_tool_path}/bin/flutter" precache

# git unsafe directory
if [[ $(is_root) -eq 0 ]]; then
git config --system --add safe.directory "${versioned_tool_path}"
else
git config --global --add safe.directory "${versioned_tool_path}"
fi

# download dart sdk and init flutter
"${versioned_tool_path}/bin/flutter" --version
# fix rights
chmod -R g+w "${versioned_tool_path}"
}

function link_tool () {
Expand Down
3 changes: 2 additions & 1 deletion test/Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
FROM ubuntu:focal as base

ARG APT_HTTP_PROXY
ARG BUILDPACK_DEBUG

# autoloading containerbase env
ENV BASH_ENV=/usr/local/etc/env ENV=/usr/local/etc/env PATH=/home/$USER_NAME/bin:$PATH
Expand All @@ -25,7 +26,7 @@ RUN uname -p | tee | grep aarch64

RUN touch /.dummy

ARG IGNORED_TOOLS=erlang,elixir,flutter,php,composer
ARG IGNORED_TOOLS=erlang,elixir,php,composer

RUN prepare-tool all

Expand Down
1 change: 1 addition & 0 deletions test/Dockerfile.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
FROM ubuntu:jammy as base

ARG APT_HTTP_PROXY
ARG BUILDPACK_DEBUG

# autoloading containerbase env
ENV BASH_ENV=/usr/local/etc/env ENV=/usr/local/etc/env PATH=/home/$USER_NAME/bin:$PATH
Expand Down
3 changes: 1 addition & 2 deletions test/flutter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN prepare-tool flutter
#--------------------------------------
# test: flutter 1.x (root)
#--------------------------------------
FROM base as testa
FROM build as testa

# renovate datasource=flutter-version
RUN install-tool flutter 1.22.6
Expand Down Expand Up @@ -102,7 +102,6 @@ RUN set -ex; \
cd c; \
flutter pub upgrade;


#--------------------------------------
# final
#--------------------------------------
Expand Down