"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "snapcraft/plugins/v1/flutter.py" between
snapcraft-4.5.1.tar.gz and snapcraft-4.5.2.tar.gz

About: Snapcraft is a build and packaging tool that makes it easy to incorporate components from different sources and build technologies or solutions.

flutter.py  (snapcraft-4.5.1):flutter.py  (snapcraft-4.5.2)
skipping to change at line 37 skipping to change at line 37
Which Flutter revision to use for the build. This must be a valid Which Flutter revision to use for the build. This must be a valid
revision from the flutter repository. revision from the flutter repository.
- flutter-target - flutter-target
(string, default: lib/main.dart) (string, default: lib/main.dart)
The main entry-point file of the application The main entry-point file of the application
This plugin works best with the flutter related extensions. This plugin works best with the flutter related extensions.
""" """
import logging import logging
import pathlib from pathlib import Path
import subprocess import subprocess
from typing import Any, Dict, List from typing import Any, Dict, List
from snapcraft import file_utils from snapcraft import file_utils
from snapcraft.plugins.v1 import PluginV1 from snapcraft.plugins.v1 import PluginV1
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class FlutterPlugin(PluginV1): class FlutterPlugin(PluginV1):
@classmethod @classmethod
skipping to change at line 78 skipping to change at line 78
super().__init__(name, options, project) super().__init__(name, options, project)
logger.warning( logger.warning(
"The flutter plugin is currently in beta, its API may break. Use at your " "The flutter plugin is currently in beta, its API may break. Use at your "
"own risk." "own risk."
) )
def pull(self) -> None: def pull(self) -> None:
super().pull() super().pull()
work_path = pathlib.Path(self.sourcedir) work_path = Path(self.sourcedir)
if self.options.source_subdir: if self.options.source_subdir:
work_path /= self.options.source_subdir work_path /= self.options.source_subdir
# Let these errors go through to get them on Sentry. # Let these errors go through to get them on Sentry.
if self.options.flutter_revision: if self.options.flutter_revision:
subprocess.run( subprocess.run(
f"yes | flutter version {self.options.flutter_revision}", f"yes | flutter version {self.options.flutter_revision}",
shell=True, shell=True,
check=True, check=True,
cwd=work_path, cwd=work_path,
skipping to change at line 108 skipping to change at line 108
"flutter", "flutter",
"build", "build",
"linux", "linux",
"--release", "--release",
"-v", "-v",
"-t", "-t",
self.options.flutter_target, self.options.flutter_target,
] ]
) )
bundle_dir_path = pathlib.Path(self.builddir) / "build/linux/release/bun # Flutter only supports arm64 and amd64
dle" if Path(self.builddir, "build/linux/x64/release/bundle").exists():
install_bin_dir_path = pathlib.Path(self.installdir) / "bin" bundle_dir_path = Path(self.builddir, "build/linux/x64/release/bundl
e")
elif Path(self.builddir, "build/linux/arm64/release/bundle").exists():
bundle_dir_path = Path(self.builddir, "build/linux/arm64/release/bun
dle")
else:
bundle_dir_path = Path(self.builddir, "build/linux/release/bundle")
install_bin_dir_path = Path(self.installdir) / "bin"
install_bin_dir_path.mkdir(exist_ok=True) install_bin_dir_path.mkdir(exist_ok=True)
# Now move everything over to the plugin's installdir # Now move everything over to the plugin's installdir
file_utils.link_or_copy_tree( file_utils.link_or_copy_tree(
bundle_dir_path.as_posix(), install_bin_dir_path.as_posix() bundle_dir_path.as_posix(), install_bin_dir_path.as_posix()
) )
 End of changes. 3 change blocks. 
5 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)