-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy path.gitpod.yml
64 lines (52 loc) · 2.47 KB
/
.gitpod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
tasks:
- name: Setup Flutter and Android
before: |
# Install Flutter
git clone https://github.com/flutter/flutter.git -b stable /home/gitpod/flutter
# Add Flutter to the PATH
echo 'export PATH="$PATH:/home/gitpod/flutter/bin"' >> /home/gitpod/.bashrc
export PATH="$PATH:/home/gitpod/flutter/bin"
# Install Flutter dependencies
sudo apt-get update && sudo apt-get install -y libgtk-3-dev libblkid-dev liblzma-dev
# Download and install Android Command Line Tools
mkdir -p /home/gitpod/android-sdk
wget https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip
unzip commandlinetools-linux-8092744_latest.zip -d /home/gitpod/android-sdk/cmdline-tools
mkdir -p /home/gitpod/android-sdk/cmdline-tools/latest
mv /home/gitpod/android-sdk/cmdline-tools/cmdline-tools/* /home/gitpod/android-sdk/cmdline-tools/latest/
rm -rf /home/gitpod/android-sdk/cmdline-tools/cmdline-tools
rm commandlinetools-linux-8092744_latest.zip
# Set up environment variables
export ANDROID_HOME=/home/gitpod/android-sdk
export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools"
echo 'export ANDROID_HOME=/home/gitpod/android-sdk' >> /home/gitpod/.bashrc
echo 'export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools"' >> /home/gitpod/.bashrc
# Install Android SDK components
yes | sdkmanager --licenses
sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0"
# Install Chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get install -y ./google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
# Set CHROME_EXECUTABLE
echo 'export CHROME_EXECUTABLE=/usr/bin/google-chrome' >> /home/gitpod/.bashrc
export CHROME_EXECUTABLE=/usr/bin/google-chrome
# Install Java
sdk install java 23.1.4.r21-nik
# Set up Flutter
flutter channel stable
flutter upgrade
flutter config --enable-web
flutter config --android-sdk $ANDROID_HOME
flutter doctor
# Get Flutter dependencies
flutter pub get
command: |
flutter run -d web-server --web-port=8080 --web-hostname=0.0.0.0
ports:
- port: 8080
onOpen: open-preview
vscode:
extensions:
- Dart-Code.flutter
- Dart-Code.dart-code