forked from leoafarias/fvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
65 lines (47 loc) · 1.92 KB
/
setup.sh
File metadata and controls
65 lines (47 loc) · 1.92 KB
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
65
#!/bin/bash
set -e
# Update system packages
sudo apt-get update
# Install required dependencies
sudo apt-get install -y apt-transport-https wget gnupg git curl
# Add Dart repository key and repository
wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/dart.gpg
echo "deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main" | sudo tee /etc/apt/sources.list.d/dart_stable.list
# Update package list and install Dart SDK
sudo apt-get update
sudo apt-get install -y dart
# Add Dart to system PATH
echo 'PATH="$PATH:/usr/lib/dart/bin"' | sudo tee -a /etc/environment
# Set PATH for current session
export PATH="$PATH:/usr/lib/dart/bin"
export PATH="$PATH:$HOME/.pub-cache/bin"
# Add to user profile for future sessions
echo 'export PATH="$PATH:/usr/lib/dart/bin"' >> $HOME/.profile
echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> $HOME/.profile
# Verify Dart installation
dart --version
# Navigate to project directory
cd /mnt/persist/workspace
# Install project dependencies
dart pub get
# Install grinder globally for build tasks
dart pub global activate grinder
# Set up Git configuration (required for FVM tests)
git config --global user.name "Test User"
git config --global user.email "test@example.com"
git config --global init.defaultBranch main
# Create necessary test directories
mkdir -p $HOME/fvm-test
mkdir -p $HOME/.fvm
mkdir -p $HOME/fvm_test_cache
# Create the Git cache directory that the tests expect
mkdir -p $HOME/fvm_test_cache/gitcache
cd $HOME/fvm_test_cache/gitcache
# Initialize a bare Git repository for the cache
git init --bare
# Add Flutter repository as remote (this creates a proper Git cache)
git remote add origin https://github.com/flutter/flutter.git
# Go back to project directory
cd /mnt/persist/workspace
# Verify grinder installation
dart pub global run grinder --version