Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: cache dart_event.dart file

appflowyafd8335e9573
diff --git a/.run/dart-event.run.xml b/.run/dart-event.run.xml
index 71ac27e8e7..911316db88 100644
--- a/.run/dart-event.run.xml
+++ b/.run/dart-event.run.xml
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="dart-event" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
- <option name="command" value="run --manifest-path $PROJECT_DIR$/scripts/flowy-tool/Cargo.toml -- dart-event --rust_source=$PROJECT_DIR$/rust-lib/ --output=$PROJECT_DIR$/app_flowy/packages/flowy_sdk/lib/dispatch/code_gen.dart" />
+ <option name="command" value="run --manifest-path $PROJECT_DIR$/scripts/flowy-tool/Cargo.toml -- dart-event --rust_source=$PROJECT_DIR$/rust-lib/ --output=$PROJECT_DIR$/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event.dart" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<option name="channel" value="DEFAULT" />
<option name="allFeatures" value="false" />
diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/code_gen.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event.dart
similarity index 100%
rename from frontend/app_flowy/packages/flowy_sdk/lib/dispatch/code_gen.dart
rename to frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event.dart
diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dispatch.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dispatch.dart
index e78641d0fb..40c7a06867 100644
--- a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dispatch.dart
+++ b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dispatch.dart
@@ -27,7 +27,7 @@ import 'package:protobuf/protobuf.dart';
import 'dart:convert' show utf8;
import 'error.dart';
-part 'code_gen.dart';
+part 'dart_event.dart';
enum FFIException {
RequestIsEmpty,
diff --git a/frontend/rust-lib/dart-ffi/build.rs b/frontend/rust-lib/dart-ffi/build.rs
index 01f337bce8..91c656ce10 100644
--- a/frontend/rust-lib/dart-ffi/build.rs
+++ b/frontend/rust-lib/dart-ffi/build.rs
@@ -11,6 +11,7 @@ fn main() {
fn copy_dart_event_files() {
let workspace_dir = std::env::var("CARGO_MAKE_WORKING_DIRECTORY").unwrap();
let flutter_sdk_path = std::env::var("FLUTTER_FLOWY_SDK_PATH").unwrap();
- let output_file = format!("{}/{}/lib/dispatch/code_gen.dart", workspace_dir, flutter_sdk_path);
+ let output_file = format!("{}/{}/lib/dispatch/dart_event.dart", workspace_dir, flutter_sdk_path);
+ println!("cargo:rerun-if-changed={}", output_file);
dart_event::write_dart_event_file(&output_file);
}
diff --git a/frontend/scripts/makefile/protobuf.toml b/frontend/scripts/makefile/protobuf.toml
index edfce94e5a..4d594b3532 100644
--- a/frontend/scripts/makefile/protobuf.toml
+++ b/frontend/scripts/makefile/protobuf.toml
@@ -107,7 +107,7 @@ script = [
flutter_lib=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages
rust_source=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/
- output=${flutter_lib}/flowy_sdk/lib/dispatch/code_gen.dart
+ output=${flutter_lib}/flowy_sdk/lib/dispatch/dart_event.dart
cargo run \
--manifest-path ${flowy_tool} dart-event \
@@ -124,7 +124,7 @@ script = [
flutter_lib=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages
rust_source=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/
- output=set ${flutter_lib}/flowy_sdk/lib/dispatch/code_gen.dart
+ output=set ${flutter_lib}/flowy_sdk/lib/dispatch/dart_event.dart
exec cmd.exe /c cargo run \
--manifest-path ${flowy_tool} dart-event \