Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend_server.dart.snapshot文件如何生成? #7

Closed
Night1992 opened this issue May 31, 2022 · 6 comments
Closed

frontend_server.dart.snapshot文件如何生成? #7

Night1992 opened this issue May 31, 2022 · 6 comments

Comments

@Night1992
Copy link

想定制一些自己的hook规则,请问如何生成frontend_server.dart.snapshot?
目前看,应该是贝壳先生成好了frontend_server.dart.snapshot后在flutter_tools编译的时候直接替换的,但是根据gen_frontend_server_snapshot.sh脚本无法生成snapshot,package_config.json中指明的third_party找不到。

@Night1992
Copy link
Author

server.dart:10:8: Error: Error when reading '../../../third_party/dart/third_party/pkg/args/lib/args.dart': No such file or directory
import 'package:args/args.dart';
^
server.dart:11:8: Error: Error when reading '../../../third_party/dart/pkg/frontend_server/lib/frontend_server.dart': No such file or directory

@soloxiao
Copy link
Collaborator

想定制一些自己的hook规则,请问如何生成frontend_server.dart.snapshot?
目前看,应该是贝壳先生成好了frontend_server.dart.snapshot后在flutter_tools编译的时候直接替换的,但是根据gen_frontend_server_snapshot.sh脚本无法生成snapshot,package_config.json中指明的third_party找不到。

你使用的是beike_aspectd的哪一个版本?

@Night1992
Copy link
Author

最新clone的,1.0.1.

@soloxiao
Copy link
Collaborator

最新clone的,1.0.1.

没有1.0.1这个分支啊。你在使用的是哪个分支呢?

@Night1992
Copy link
Author

哦哦,yaml里的版本号是1.0.1,分支是3.0.0

@soloxiao
Copy link
Collaborator

soloxiao commented Jun 2, 2022

哦哦,yaml里的版本号是1.0.1,分支是3.0.0

beike_aspectd 3.0.0版本为了方便生成frontend_server.dart.snapshot,把相关的dart代码内置到inner里了。如果要重新生成需先在inner目录下pub get,然后到flutter_frontend_server目录下执行
dart --deterministic --snapshot=frontend_server.dart.snapshot starter.dart。如下图

image

除了这种方法,还可以下载3.0.0对应的dart代码,然后将yaml文件指定到相应的pkg目录(直接依赖远端也是可以的)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants