ci: fix ci errors

This commit is contained in:
appflowy 2022-02-16 12:22:26 +08:00
parent 0aed86737f
commit 2a6ce12a55
6 changed files with 10 additions and 12 deletions

View File

@ -41,9 +41,6 @@ jobs:
with: with:
toolchain: stable toolchain: stable
override: true override: true
- name: Install cargo-make
run: cargo install --force cargo-make
working-directory: frontend
- run: rustup component add clippy - run: rustup component add clippy
working-directory: frontend/rust-lib working-directory: frontend/rust-lib
- run: cargo clippy --no-default-features - run: cargo clippy --no-default-features

View File

@ -78,4 +78,4 @@ build/
**/*.lib **/*.lib
**/*.dll **/*.dll
**/*.so **/*.so
lib/**/dart_event.dart # lib/**/dart_event.dart

View File

@ -1,7 +1,7 @@
use dashmap::{DashMap, DashSet}; use dashmap::{DashMap, DashSet};
use flowy_ast::{Ctxt, TyInfo}; use flowy_ast::{Ctxt, TyInfo};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use lib_infra::code_gen::protobuf_file::ProtoCache; use lib_infra::code_gen::ProtoCache;
use std::fs::File; use std::fs::File;
use std::io::Read; use std::io::Read;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};

View File

@ -43,7 +43,7 @@ pub fn gen(crate_name: &str) {
} }
const DART_IMPORTED: &str = r#" const DART_IMPORTED: &str = r#"
/// Auto gen code from rust ast, do not edit /// Auto generate. Do not edit
part of 'dispatch.dart'; part of 'dispatch.dart';
"#; "#;

View File

@ -9,3 +9,9 @@ mod flowy_toml;
#[cfg(any(feature = "pb_gen", feature = "dart_event"))] #[cfg(any(feature = "pb_gen", feature = "dart_event"))]
pub mod util; pub mod util;
#[derive(serde::Serialize, serde::Deserialize)]
pub struct ProtoCache {
pub structs: Vec<String>,
pub enums: Vec<String>,
}

View File

@ -6,6 +6,7 @@ use crate::code_gen::protobuf_file::ast::parse_crate_protobuf;
use crate::code_gen::protobuf_file::proto_info::ProtobufCrateContext; use crate::code_gen::protobuf_file::proto_info::ProtobufCrateContext;
use crate::code_gen::protobuf_file::ProtoFile; use crate::code_gen::protobuf_file::ProtoFile;
use crate::code_gen::util::*; use crate::code_gen::util::*;
use crate::code_gen::ProtoCache;
use std::fs::File; use std::fs::File;
use std::path::Path; use std::path::Path;
use std::{fs::OpenOptions, io::Write}; use std::{fs::OpenOptions, io::Write};
@ -92,12 +93,6 @@ fn write_rust_crate_mod_file(crate_contexts: &[ProtobufCrateContext]) {
} }
} }
#[derive(serde::Serialize, serde::Deserialize)]
pub struct ProtoCache {
pub structs: Vec<String>,
pub enums: Vec<String>,
}
impl ProtoCache { impl ProtoCache {
fn from_crate_contexts(crate_contexts: &[ProtobufCrateContext]) -> Self { fn from_crate_contexts(crate_contexts: &[ProtobufCrateContext]) -> Self {
let proto_files = crate_contexts let proto_files = crate_contexts