How to snap dart console project

Is there a way to snap dart console project?.
Found this post that talk about snapping dart sdk with no luck.
Is there a way to snap only a dart project?.
It can even be indirectly like snapping Bash script and project files and the bash script will execute the project with command.
Does making zip and using plugin: dump can help me?

Thanks in advance.

Edit:
Found out about dart2aot that produce .dart.aot and contains all the program in one file, It should be easier to snap one file which contains all the program.

Managed to get things working using

    parts:
  main:
    plugin: dump
    source: .

apps:
  main:
    command: dart-sdk/bin/dart $SNAP/projectName/bin/main.dart

Downloaded the dart-sdk and packaged it inside the snap.
The dart-sdk will be only for specific architecture.

1 Like