Skip to content

Commit

Permalink
Switch to FVM for version management
Browse files Browse the repository at this point in the history
Partially based on ashuntu/app-center@a730f36
  • Loading branch information
ashuntu committed Aug 27, 2024
1 parent 5304045 commit 03e1498
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.24.1"
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ coverage/
# IntelliJ related
*.iml
*.idea

# FVM Version Cache
.fvm/
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

2 changes: 1 addition & 1 deletion packages/game_center/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies:
intl: ^0.19.0
path: ^1.9.0
riverpod_annotation: ^2.3.5
ubuntu_lints: ^0.4.0
ubuntu_localizations: ^0.4.0
ubuntu_logger: ^0.1.1
ubuntu_service: ^0.3.2
Expand All @@ -32,6 +31,7 @@ dev_dependencies:
sdk: flutter
mockito: ^5.4.4
riverpod_generator: ^2.4.2
ubuntu_lints: ^0.4.0
yaru_test: ^0.1.6

flutter:
Expand Down
17 changes: 13 additions & 4 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@ parts:
fi
craftctl default
FLUTTER_VERSION=$(sed -n "s/^flutter \([0-9.]\+\).*/\1/p" .tool-versions)
git clone -b $FLUTTER_VERSION --depth 1 https://github.com/flutter/flutter.git
FVM_VERSION=$(curl -s https://api.github.com/repos/leoafarias/fvm/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
curl -L "https://github.com/leoafarias/fvm/releases/download/$FVM_VERSION/fvm-$FVM_VERSION-linux-x64.tar.gz" -o fvm.tar.gz
override-build: |
mkdir -p $CRAFT_PART_INSTALL/usr/bin
mkdir -p $CRAFT_PART_INSTALL/usr/libexec
cp -r $CRAFT_PART_SRC/flutter $CRAFT_PART_INSTALL/usr/libexec/flutter
cp $CRAFT_PART_SRC/.fvmrc $CRAFT_PART_INSTALL
tar xzf fvm.tar.gz
rm fvm.tar.gz
mv fvm $CRAFT_PART_INSTALL/fvm
ln -s $CRAFT_PART_INSTALL/fvm/fvm $CRAFT_PART_INSTALL/usr/bin/fvm
cd $CRAFT_PART_INSTALL
$CRAFT_PART_INSTALL/usr/bin/fvm install
cp -r $CRAFT_PART_INSTALL/.fvm/flutter_sdk $CRAFT_PART_INSTALL/usr/libexec/flutter
ln -s $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/flutter $CRAFT_PART_INSTALL/usr/bin/flutter
ln -s $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/dart $CRAFT_PART_INSTALL/usr/bin/dart
$CRAFT_PART_INSTALL/usr/bin/flutter doctor
Expand All @@ -48,7 +57,7 @@ parts:
override-prime: ""

game-center:
after:
after:
- flutter-git
plugin: nil
source: .
Expand Down

0 comments on commit 03e1498

Please sign in to comment.