Open KirioXX opened 2 years ago
I found that I can override the build with the override-build option. My config looks now like this:
parts:
supercool-app:
source: .
plugin: flutter
flutter-target: lib/main.dart
override-build: |
export PATH="$PATH":"$HOME/.pub-cache/bin"
flutter pub global activate melos
melos bootstrap
snapcraftctl build
The new problem is that the build path is set to apps/snap_app
.
This means the other packages are not imported and melos fails that the project is not a melos project.
What's the error? You can run Melos from anywhere in the project tree and it walks up the tree until it finds melos.yaml
.
For example, running Melos somewhere deep in a subdirectory such as ./packages/ubuntu_desktop_installer/build/linux/x64/debug/bundle
finds ./melos.yaml
:
jpnurmi@xps-13-9310:~/Projects/canonical/ubuntu-desktop-installer/packages/ubuntu_desktop_installer/build/linux/x64/debug/bundle (main)$ melos bootstrap
melos bootstrap
└> /home/jpnurmi/Projects/canonical/ubuntu-desktop-installer
Running "flutter pub get" in workspace packages...
✓ glibc
└> packages/glibc
✓ subiquity_client
└> packages/subiquity_client
✓ ubuntu_desktop_installer
└> packages/ubuntu_desktop_installer
✓ ubuntu_test
└> packages/ubuntu_test
✓ ubuntu_wizard
└> packages/ubuntu_wizard
✓ ubuntu_wsl_setup
└> packages/ubuntu_wsl_setup
✓ udev
└> packages/udev
Linking workspace packages...
> SUCCESS
Generating IntelliJ IDE files...
> SUCCESS
-> 7 plugins bootstrapped
Thanks for the response @jpnurmi. The configuration in my github action looks like this:
- name: Build snap
uses: snapcore/action-build@v1
with:
path: ./apps/snap_app
id: snapcraft
and I think that is the problem. It looks like it just imports the snap_app folder and not the complete project. The error I get is this one:
melos.yaml: Your current directory does not appear to be a valid Melos workspace.
You must have one of the following to be a valid Melos workspace:
- a "melos.yaml" file in the root with a "packages" option defined
- a "packages" directory
But when I move the snap config to the root of the project is it not running the snapcraftctl build
in the snap_app folder.
Even not when I try to navigate to it in the override-build
configuration.
I probably just miss something in the config for the snapcraftctl build
comand to point the command to the correct place
but I can not find what I could miss.
Hi, thanks for this project. It made the start to package our flutter app a breeze.
We lately moved to a mono repository structure with melos to make the maintenance of our flutter apps a bit easier and share some code between the project. Our structure looks like this:
I'm pretty new to snapcraft and my question is would it be possible to switch out the install step for melos to link up the widgets or do I need to rebuild the build completely from scratch to make this work? Also, would I need to move the snap configuration to the root of the project to make the widgets even discoverable for the build process?
For a bit more context this is our current configuration that lives in apps/snap_app/snap :
Thank you in advance!