Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flutter-base
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker images
flutter
flutter-base
Commits
185c70ca
Commit
185c70ca
authored
3 months ago
by
Andri Joos
Browse files
Options
Downloads
Patches
Plain Diff
wip: add arm64 support
parent
d5cdbade
No related branches found
No related tags found
No related merge requests found
Pipeline
#7668
canceled with stage
Stage:
in 16 minutes and 7 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gclient
+13
-0
13 additions, 0 deletions
.gclient
.vscode/tasks.json
+4
-1
4 additions, 1 deletion
.vscode/tasks.json
Dockerfile
+31
-2
31 additions, 2 deletions
Dockerfile
build_engine.sh
+23
-0
23 additions, 0 deletions
build_engine.sh
test_engine.sh
+49
-0
49 additions, 0 deletions
test_engine.sh
with
120 additions
and
3 deletions
.gclient
0 → 100644
+
13
−
0
View file @
185c70ca
solutions = [
{
"custom_deps": {},
"deps_file": "DEPS",
"managed": False,
"name": "src/flutter",
"safesync_url": "",
"url": "https://github.com/flutter/engine.git",
"custom_vars": {
"download_emsdk": True,
},
},
]
This diff is collapsed.
Click to expand it.
.vscode/tasks.json
+
4
−
1
View file @
185c70ca
...
...
@@ -12,7 +12,10 @@
"--build-arg"
,
"FLUTTER_VERSION=${input:flutterVersion}"
,
"--platform"
,
"linux/amd64"
,
"linux/arm64"
,
"--tag"
,
"andrijoos/flutter:${input:flutterVersion}-dev"
,
"--load"
,
"."
,
],
},
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
31
−
2
View file @
185c70ca
...
...
@@ -17,8 +17,35 @@ RUN apt update \
RUN
mkdir
-p
${
FLUTTER_DIR
}
RUN
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_
${
FLUTTER_VERSION
}
-stable
.tar.xz
-O
${
FLUTTER_DOWNLOAD_FILE
}
\
&&
tar
-xf
${
FLUTTER_DOWNLOAD_FILE
}
--strip-components
=
1
--directory
$FLUTTER_DIR
;
ENV
PATH="$PATH:/opt/depot_tools"
# Use precompiled binaries
RUN if
[
"
$(
uname
-m
)
"
=
"x86_64"
]
;
then
\
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_
${
FLUTTER_VERSION
}
-stable
.tar.xz
-O
${
FLUTTER_DOWNLOAD_FILE
}
\
&&
tar
-xf
${
FLUTTER_DOWNLOAD_FILE
}
--strip-components
=
1
--directory
$FLUTTER_DIR
;
\
fi
COPY
.gclient /engine
# RUN if [ "$(uname -m)" = "aarch64" ]; then \
# git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools \
# && git clone --depth 1 https://github.com/flutter/engine.git engine \
# && cd engine \
# && gclient config https://github.com/flutter/engine.git \
# # && git pull upstream master \
# && gclient sync \
# && ./flutter/tools/gn --target-os=linux --linux-cpu=arm64 \
# && ninja -C out/linux_release_arm64; \
# fi
# RUN ls out && exit 1
# apt update && apt install -y git wget python3 xz-utils pkg-config
# PATH="$PATH:/opt/depot_tools" && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools
# git clone --depth 1 https://github.com/flutter/engine.git engine
# # cd engine && fetch flutter
# cd engine && cp /app/.gclient . && gclient sync
# ./src/flutter/tools/gn --android --android-cpu arm64
# There is no official flutter arm64 release, so we must use the github repo
# Flutter on arch currently has warnings because channel and repository source are not set
...
...
@@ -73,5 +100,7 @@ RUN dart --disable-analytics \
--no-enable-fuchsia
\
&&
flutter precache
--universal
# On arm64, set flutter config local engine
# Test flutter
# RUN flutter doctor --verbose && exit 1
This diff is collapsed.
Click to expand it.
build_engine.sh
0 → 100644
+
23
−
0
View file @
185c70ca
# Currently, only android and linux are supported.
# https://github.com/flutter/engine/blob/main/docs/contributing/Compiling-the-engine.md
# todo: release/profile, linux, maybe copy only flutter.jar?
apt update
&&
apt
install
-y
git wget python3 xz-utils pkg-config openjdk-17-jdk
PATH
=
"
$PATH
:/opt/depot_tools"
&&
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools
git clone
--depth
1 https://github.com/flutter/engine.git /engine
cp
.gclient /engine
cd
/engine
rm
pubspec.yaml
gclient
sync
cd
src
flutter/tools/gn
--unoptimized
--runtime-mode
=
debug
ninja
-C
out/host_debug_unopt
flutter/tools/gn
--android
--android-cpu
arm64
--unoptimized
--runtime-mode
=
debug
# flutter/tools/gn --android --android-cpu arm64 --runtime-mode=profile
# flutter/tools/gn --android --android-cpu arm64 --runtime-mode=release
ninja
-C
out/android_debug_unopt_arm64
# ninja -C out/android_profile_arm64
# ninja -C out/android_release_arm64
This diff is collapsed.
Click to expand it.
test_engine.sh
0 → 100644
+
49
−
0
View file @
185c70ca
# When running on docker, run `docker run --rm --privileged multiarch/qemu-user-static --reset -p yes` to enable emulation
apt update
apt
install
-y
wget xz-utils git curl unzip
# FLUTTER_VERSION="3.27.1"
# FLUTTER_DOWNLOAD_FILE="flutter.zip"
# wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz -O ${FLUTTER_DOWNLOAD_FILE}
# mkdir -p /flutter
# tar -xf ${FLUTTER_DOWNLOAD_FILE} --strip-components=1 --directory /flutter
FLUTTER_DIR
=
/opt/flutter
FLUTTER_VERSION
=
3.27.1
git clone
--depth
1 https://github.com/flutter/flutter.git
${
FLUTTER_DIR
}
cd
${
FLUTTER_DIR
}
git fetch origin tag
${
FLUTTER_VERSION
}
git checkout tags/
${
FLUTTER_VERSION
}
PATH
=
"
${
PATH
}
:
${
FLUTTER_DIR
}
/bin"
cd
/
flutter precache
--universal
# # Test android
apt
install
-y
openjdk-17-jdk
export
ANDROID_HOME
=
"/opt/android"
CMDLINETOOLS_DIR
=
"
$ANDROID_HOME
/cmdline-tools/latest"
CMDLINETOOLS_VERSION
=
"11076708"
CMDLINETOOLS_ZIP
=
"/tmp/cmdline-tools.zip"
wget
"https://dl.google.com/android/repository/commandlinetools-linux-
${
CMDLINETOOLS_VERSION
}
_latest.zip"
-O
$CMDLINETOOLS_ZIP
unzip
-q
$CMDLINETOOLS_ZIP
-d
/tmp
mkdir
-p
${
CMDLINETOOLS_DIR
}
mv
/tmp/cmdline-tools/
*
$CMDLINETOOLS_DIR
PATH
=
"
${
PATH
}
:
${
ANDROID_HOME
}
/cmdline-tools/latest/bin:
${
ANDROID_HOME
}
/platform-tools"
yes
| sdkmanager
--sdk_root
=
${
ANDROID_HOME
}
--licenses
yes
"y"
| flutter doctor
--android-licenses
flutter precache
--universal
--android
flutter config
--local-engine-src-path
/out/engine/src/
--local-engine
/out/engine/src/out/android_debug_unopt_arm64/
--local-engine-host
/out/engine/src/out/host_debug_unopt/
flutter config
--enable-android
flutter create
--project-name
android_test
-t
app
--platforms
android android_test
cd
android_test/android
./gradlew wrapper
--gradle-version
=
8.1
cd
..
flutter pub get
flutter build appbundle
--debug
--target-platform
android-arm64
# # flutter build appbundle --profile --target-platform android-arm,android-arm64,android-x64
# # flutter build appbundle --release --target-platform android-arm,android-arm64,android-x64
# cd ..
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment