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

Add protoc-gen-dart's parent folder to PATH before run protobuf compiler. #124

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions example/native/hub/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ fn main() {
.output()
.expect("Cannot globally install `protoc_plugin` Dart package");

//Add protoc-gen-dart's parent folder to environment variable `PATH`.
env::set_var(
"PATH",
format!(
"{}:{}/.pub-cache/bin",
env::var("PATH").unwrap(),
env::var("HOME").unwrap(),
),
);

// Generate Dart message files.
let _ = fs::create_dir(&dart_output_path);
for result in fs::read_dir(&dart_output_path).unwrap() {
Expand Down