chore: upgrade minimum support flutter version, >= 3.3.0 (#1551)

* feat: upgrade flutter version to 3.3.0 for appflowy_editor and appflowy_editor_plugin

* feat: upgrade flutter version to 3.3.0 for appflowy

* feat: upgrade flutter version to 3.3.0 for CI

* chore: update flutter version in ci workflows

* chore: fix warnings

* chore: fix unuse import

* chore: support  cargo make dart_unit_test on windows platform

* fix: copy to sandbox errors

Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
Lucas.Xu
2023-01-01 23:26:27 +08:00
committed by GitHub
parent 9cd83d02a9
commit c05c1e191c
26 changed files with 206 additions and 96 deletions

View File

@ -30,7 +30,7 @@ jobs:
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
channel: "stable" channel: "stable"
flutter-version: "3.0.5" flutter-version: "3.3.9"
cache: true cache: true
- name: Run FlowyEditor tests - name: Run FlowyEditor tests

View File

@ -38,7 +38,7 @@ jobs:
with: with:
channel: "stable" channel: "stable"
cache: true cache: true
flutter-version: "3.0.5" flutter-version: "3.3.9"
- name: Cache Cargo - name: Cache Cargo
id: cache-cargo id: cache-cargo

View File

@ -32,7 +32,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- uses: subosito/flutter-action@v1 - uses: subosito/flutter-action@v1
with: with:
flutter-version: "3.0.5" flutter-version: "3.3.9"
channel: "stable" channel: "stable"
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:

View File

@ -30,7 +30,7 @@ jobs:
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
channel: "stable" channel: "stable"
flutter-version: "3.0.5" flutter-version: "3.3.9"
cache: true cache: true
- name: Cache Cargo - name: Cache Cargo

View File

@ -35,7 +35,7 @@ jobs:
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
channel: "stable" channel: "stable"
flutter-version: "3.0.5" flutter-version: "3.3.9"
cache: true cache: true
- name: Cache Cargo - name: Cache Cargo

View File

@ -51,7 +51,7 @@ jobs:
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
channel: 'stable' channel: 'stable'
flutter-version: '3.0.5' flutter-version: '3.3.9'
- name: Pre build - name: Pre build
working-directory: frontend working-directory: frontend
@ -136,7 +136,7 @@ jobs:
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
channel: 'stable' channel: 'stable'
flutter-version: '3.0.5' flutter-version: '3.3.9'
- name: Pre build - name: Pre build
working-directory: frontend working-directory: frontend
@ -211,7 +211,7 @@ jobs:
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
channel: 'stable' channel: 'stable'
flutter-version: '3.0.5' flutter-version: '3.3.9'
- name: Pre build - name: Pre build
working-directory: frontend working-directory: frontend
@ -284,7 +284,7 @@ jobs:
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
channel: 'stable' channel: 'stable'
flutter-version: '3.0.5' flutter-version: '3.3.9'
- name: Pre build - name: Pre build
working-directory: frontend working-directory: frontend

View File

@ -49,7 +49,7 @@ jobs:
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
channel: 'stable' channel: 'stable'
flutter-version: '3.0.5' flutter-version: '3.3.9'
- name: Install code-coverage tools - name: Install code-coverage tools
working-directory: frontend working-directory: frontend

View File

@ -32,7 +32,7 @@ jobs:
override: true override: true
- uses: subosito/flutter-action@v1 - uses: subosito/flutter-action@v1
with: with:
flutter-version: '3.0.5' flutter-version: '3.3.9'
channel: "stable" channel: "stable"
- name: Rust Deps - name: Rust Deps

View File

@ -20,7 +20,6 @@ import 'package:flowy_sdk/protobuf/flowy-grid/field_entities.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-grid/row_entities.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-grid/row_entities.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import '../../grid/application/row/row_cache.dart';
import '../application/board_bloc.dart'; import '../application/board_bloc.dart';
import 'card/card.dart'; import 'card/card.dart';
import 'card/card_cell_builder.dart'; import 'card/card_cell_builder.dart';

View File

@ -41,8 +41,8 @@ class DateCalBloc extends Bloc<DateCalEvent, DateCalState> {
}, },
didReceiveCellUpdate: (DateCellDataPB? cellData) { didReceiveCellUpdate: (DateCellDataPB? cellData) {
final calData = calDataFromCellData(cellData); final calData = calDataFromCellData(cellData);
final time = final time = calData.foldRight(
calData.foldRight("", (dateData, previous) => dateData.time); "", (dateData, previous) => dateData.time ?? '');
emit(state.copyWith(calData: calData, time: time)); emit(state.copyWith(calData: calData, time: time));
}, },
setIncludeTime: (includeTime) async { setIncludeTime: (includeTime) async {
@ -224,7 +224,8 @@ class DateCalState with _$DateCalState {
DateCellDataPB? cellData, DateCellDataPB? cellData,
) { ) {
Option<CalendarData> calData = calDataFromCellData(cellData); Option<CalendarData> calData = calDataFromCellData(cellData);
final time = calData.foldRight("", (dateData, previous) => dateData.time); final time =
calData.foldRight("", (dateData, previous) => dateData.time ?? '');
return DateCalState( return DateCalState(
dateTypeOptionPB: dateTypeOptionPB, dateTypeOptionPB: dateTypeOptionPB,
format: CalendarFormat.month, format: CalendarFormat.month,

View File

@ -13,7 +13,6 @@ import '../../../../main.dart';
import '../../../../startup/launch_configuration.dart'; import '../../../../startup/launch_configuration.dart';
import '../../../../startup/startup.dart'; import '../../../../startup/startup.dart';
import '../../../../startup/tasks/prelude.dart'; import '../../../../startup/tasks/prelude.dart';
import '../../../application/settings/settings_location_cubit.dart';
class SettingsFileLocationCustomzier extends StatefulWidget { class SettingsFileLocationCustomzier extends StatefulWidget {
const SettingsFileLocationCustomzier({ const SettingsFileLocationCustomzier({

View File

@ -80,7 +80,7 @@ class _CurrentIcon extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_setIcon(String iconUrl) { void setIcon(String iconUrl) {
context context
.read<SettingsUserViewBloc>() .read<SettingsUserViewBloc>()
.add(SettingsUserEvent.updateUserIcon(iconUrl)); .add(SettingsUserEvent.updateUserIcon(iconUrl));
@ -90,23 +90,28 @@ class _CurrentIcon extends StatelessWidget {
return Material( return Material(
color: Colors.transparent, color: Colors.transparent,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return SimpleDialog( return SimpleDialog(
title: FlowyText.medium( title: FlowyText.medium(
'Select an Icon', 'Select an Icon',
fontSize: FontSizes.s16, fontSize: FontSizes.s16,
), ),
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 300, width: 300, child: IconGallery(_setIcon)) height: 300,
]); width: 300,
}, child: IconGallery(setIcon),
); )
}, ],
child: Column(children: <Widget>[ );
},
);
},
child: Column(
children: <Widget>[
const Align( const Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
@ -114,14 +119,17 @@ class _CurrentIcon extends StatelessWidget {
style: TextStyle(color: Colors.grey), style: TextStyle(color: Colors.grey),
)), )),
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Container( child: Container(
margin: const EdgeInsets.all(5.0), margin: const EdgeInsets.all(5.0),
decoration: decoration:
BoxDecoration(border: Border.all(color: Colors.grey)), BoxDecoration(border: Border.all(color: Colors.grey)),
child: svgWidget('emoji/$iconUrl', size: const Size(60, 60)), child: svgWidget('emoji/$iconUrl', size: const Size(60, 60)),
)), ),
])), ),
],
),
),
); );
} }
} }

View File

@ -1,5 +1,4 @@
import 'dart:collection'; import 'dart:collection';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';

View File

@ -68,7 +68,7 @@ class _AppFlowyInputState extends State<AppFlowyInput>
final Map<ShortcutActivator, Intent> _shortcuts = kIsWeb final Map<ShortcutActivator, Intent> _shortcuts = kIsWeb
? { ? {
LogicalKeySet(LogicalKeyboardKey.space): LogicalKeySet(LogicalKeyboardKey.space):
DoNothingAndStopPropagationIntent(), const DoNothingAndStopPropagationIntent(),
} }
: {}; : {};

View File

@ -92,6 +92,7 @@ class _AppFlowyScrollState extends State<AppFlowyScroll>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Listener( return Listener(
onPointerSignal: _onPointerSignal, onPointerSignal: _onPointerSignal,
onPointerPanZoomUpdate: _onPointerPanZoomUpdate,
child: CustomScrollView( child: CustomScrollView(
key: _scrollViewKey, key: _scrollViewKey,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
@ -134,4 +135,11 @@ class _AppFlowyScrollState extends State<AppFlowyScroll>
scrollTo(dy); scrollTo(dy);
} }
} }
void _onPointerPanZoomUpdate(PointerPanZoomUpdateEvent event) {
if (_scrollEnabled) {
final dy = (_scrollController.position.pixels - event.panDelta.dy);
scrollTo(dy);
}
}
} }

View File

@ -49,7 +49,14 @@ class SelectionGestureDetectorState extends State<SelectionGestureDetector> {
gestures: { gestures: {
PanGestureRecognizer: PanGestureRecognizer:
GestureRecognizerFactoryWithHandlers<PanGestureRecognizer>( GestureRecognizerFactoryWithHandlers<PanGestureRecognizer>(
() => PanGestureRecognizer(), () => PanGestureRecognizer(supportedDevices: {
// https://docs.flutter.dev/release/breaking-changes/trackpad-gestures#for-gesture-interactions-not-suitable-for-trackpad-usage
// Exclude PointerDeviceKind.trackpad.
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.stylus,
PointerDeviceKind.invertedStylus,
}),
(recognizer) { (recognizer) {
recognizer recognizer
..onStart = widget.onPanStart ..onStart = widget.onPanStart

View File

@ -10,8 +10,8 @@ platforms:
web: web:
environment: environment:
sdk: ">=2.17.0 <3.0.0" sdk: ">=2.18.0 <3.0.0"
flutter: ">=1.17.0" flutter: ">=3.3.0"
dependencies: dependencies:
flutter: flutter:

View File

@ -8,7 +8,7 @@ void main() async {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
}); });
Node _createEmptyEditorRoot() { Node createEmptyEditorRoot() {
return Node( return Node(
type: 'editor', type: 'editor',
children: LinkedList(), children: LinkedList(),
@ -17,7 +17,7 @@ void main() async {
} }
test("HistoryItem #1", () { test("HistoryItem #1", () {
final document = Document(root: _createEmptyEditorRoot()); final document = Document(root: createEmptyEditorRoot());
final editorState = EditorState(document: document); final editorState = EditorState(document: document);
final historyItem = HistoryItem(); final historyItem = HistoryItem();
@ -35,7 +35,7 @@ void main() async {
}); });
test("HistoryItem #2", () { test("HistoryItem #2", () {
final document = Document(root: _createEmptyEditorRoot()); final document = Document(root: createEmptyEditorRoot());
final editorState = EditorState(document: document); final editorState = EditorState(document: document);
final historyItem = HistoryItem(); final historyItem = HistoryItem();

View File

@ -162,7 +162,7 @@ class __CodeBlockNodeWidgeState extends State<_CodeBlockNodeWidge>
var currentSpans = spans; var currentSpans = spans;
List<List<TextSpan>> stack = []; List<List<TextSpan>> stack = [];
_traverse(highlight.Node node) { void traverse(highlight.Node node) {
if (node.value != null) { if (node.value != null) {
currentSpans.add(node.className == null currentSpans.add(node.className == null
? TextSpan(text: node.value) ? TextSpan(text: node.value)
@ -177,7 +177,7 @@ class __CodeBlockNodeWidgeState extends State<_CodeBlockNodeWidge>
currentSpans = tmp; currentSpans = tmp;
for (var n in node.children!) { for (var n in node.children!) {
_traverse(n); traverse(n);
if (n == node.children!.last) { if (n == node.children!.last) {
currentSpans = stack.isEmpty ? spans : stack.removeLast(); currentSpans = stack.isEmpty ? spans : stack.removeLast();
} }
@ -186,7 +186,7 @@ class __CodeBlockNodeWidgeState extends State<_CodeBlockNodeWidge>
} }
for (var node in nodes) { for (var node in nodes) {
_traverse(node); traverse(node);
} }
return spans; return spans;

View File

@ -6,8 +6,8 @@ homepage: https://github.com/AppFlowy-IO/AppFlowy
publish_to: none publish_to: none
environment: environment:
sdk: ">=2.17.6 <3.0.0" sdk: ">=2.18.0 <3.0.0"
flutter: ">=1.17.0" flutter: ">=3.3.0"
dependencies: dependencies:
flutter: flutter:

View File

@ -1,16 +1,16 @@
import 'package:flowy_infra_ui_platform_interface/flowy_infra_ui_platform_interface.dart'; import 'package:flowy_infra_ui_platform_interface/flowy_infra_ui_platform_interface.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import '../flowy_infra_ui_platform_interface.dart';
// ignore_for_file: constant_identifier_names // ignore_for_file: constant_identifier_names
const INFRA_UI_METHOD_CHANNEL_NAME = 'flowy_infra_ui_method'; const INFRA_UI_METHOD_CHANNEL_NAME = 'flowy_infra_ui_method';
const INFRA_UI_KEYBOARD_EVENT_CHANNEL_NAME = 'flowy_infra_ui_event/keyboard'; const INFRA_UI_KEYBOARD_EVENT_CHANNEL_NAME = 'flowy_infra_ui_event/keyboard';
const INFRA_UI_METHOD_GET_PLATFORM_VERSION = 'getPlatformVersion'; const INFRA_UI_METHOD_GET_PLATFORM_VERSION = 'getPlatformVersion';
class MethodChannelFlowyInfraUI extends FlowyInfraUIPlatform { class MethodChannelFlowyInfraUI extends FlowyInfraUIPlatform {
final MethodChannel _methodChannel = const MethodChannel(INFRA_UI_METHOD_CHANNEL_NAME); final MethodChannel _methodChannel =
final EventChannel _keyboardChannel = const EventChannel(INFRA_UI_KEYBOARD_EVENT_CHANNEL_NAME); const MethodChannel(INFRA_UI_METHOD_CHANNEL_NAME);
final EventChannel _keyboardChannel =
const EventChannel(INFRA_UI_KEYBOARD_EVENT_CHANNEL_NAME);
late final Stream<bool> _onKeyboardVisibilityChange = late final Stream<bool> _onKeyboardVisibilityChange =
_keyboardChannel.receiveBroadcastStream().map((event) => event as bool); _keyboardChannel.receiveBroadcastStream().map((event) => event as bool);
@ -20,7 +20,8 @@ class MethodChannelFlowyInfraUI extends FlowyInfraUIPlatform {
@override @override
Future<String> getPlatformVersion() async { Future<String> getPlatformVersion() async {
String? version = await _methodChannel.invokeMethod<String>(INFRA_UI_METHOD_GET_PLATFORM_VERSION); String? version = await _methodChannel
.invokeMethod<String>(INFRA_UI_METHOD_GET_PLATFORM_VERSION);
return version ?? 'unknow'; return version ?? 'unknow';
} }
} }

View File

@ -9,7 +9,7 @@ packages:
source: hosted source: hosted
version: "46.0.0" version: "46.0.0"
analyzer: analyzer:
dependency: "direct overridden" dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -56,7 +56,7 @@ packages:
name: archive name: archive
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.11" version: "3.3.0"
args: args:
dependency: transitive dependency: transitive
description: description:
@ -70,7 +70,7 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.8.2" version: "2.9.0"
bloc: bloc:
dependency: "direct main" dependency: "direct main"
description: description:
@ -154,7 +154,7 @@ packages:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
charcode: charcode:
dependency: "direct main" dependency: "direct main"
description: description:
@ -182,7 +182,7 @@ packages:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.1"
code_builder: code_builder:
dependency: transitive dependency: transitive
description: description:
@ -252,14 +252,14 @@ packages:
name: coverage name: coverage
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.5.0"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
name: crypto name: crypto
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.0.2"
csslib: csslib:
dependency: transitive dependency: transitive
description: description:
@ -378,7 +378,7 @@ packages:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.1"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
@ -714,21 +714,21 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.11" version: "0.12.12"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.4" version: "0.1.5"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.7.0" version: "1.8.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -819,7 +819,7 @@ packages:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.1" version: "1.8.2"
path_drawing: path_drawing:
dependency: transitive dependency: transitive
description: description:
@ -1153,7 +1153,7 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.2" version: "1.9.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -1181,7 +1181,7 @@ packages:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.1"
styled_widget: styled_widget:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1195,7 +1195,7 @@ packages:
name: sync_http name: sync_http
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.3.0" version: "0.3.1"
table_calendar: table_calendar:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1209,28 +1209,28 @@ packages:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
test: test:
dependency: transitive dependency: transitive
description: description:
name: test name: test
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.21.1" version: "1.21.4"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.9" version: "0.4.12"
test_core: test_core:
dependency: transitive dependency: transitive
description: description:
name: test_core name: test_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.13" version: "0.4.16"
textfield_tags: textfield_tags:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1272,7 +1272,7 @@ packages:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.1"
universal_platform: universal_platform:
dependency: transitive dependency: transitive
description: description:
@ -1356,7 +1356,7 @@ packages:
name: vm_service name: vm_service
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "8.2.2" version: "9.0.0"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@ -1423,5 +1423,5 @@ packages:
source: hosted source: hosted
version: "3.1.1" version: "3.1.1"
sdks: sdks:
dart: ">=2.17.6 <3.0.0" dart: ">=2.18.0 <3.0.0"
flutter: ">=3.0.0" flutter: ">=3.3.0"

View File

@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.17.0 <3.0.0" sdk: ">=2.18.0 <3.0.0"
# Dependencies specify other packages that your package needs in order to work. # Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions # To automatically upgrade your package dependencies to the latest versions
@ -105,9 +105,6 @@ dev_dependencies:
freezed: ^2.1.0+1 freezed: ^2.1.0+1
bloc_test: ^9.0.2 bloc_test: ^9.0.2
dependency_overrides:
analyzer: ">=4.4.0 <5.0.0"
# The "flutter_lints" package below contains a set of recommended lints to # The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is # encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your # activated in the `analysis_options.yaml` file located at the root of your

View File

@ -27,7 +27,7 @@ parking_lot = "0.12.1"
lib-dispatch = { path = "../lib-dispatch" } lib-dispatch = { path = "../lib-dispatch" }
flowy-sdk = { path = "../flowy-sdk" } flowy-sdk = { path = "../flowy-sdk" }
dart-notify = { path = "../dart-notify", feature = ["dart"] } dart-notify = { path = "../dart-notify" }
flowy-derive = { path = "../flowy-derive" } flowy-derive = { path = "../flowy-derive" }
[features] [features]

View File

@ -6,7 +6,14 @@
[tasks.env_check] [tasks.env_check]
dependencies = ["echo_env", "install_protobuf"] dependencies = ["echo_env", "install_protobuf"]
condition = { env_set = [ "BUILD_FLAG", "RUST_COMPILE_TARGET", "CRATE_TYPE", "TARGET_OS"], channels = ["stable"] } condition = { env_set = [
"BUILD_FLAG",
"RUST_COMPILE_TARGET",
"CRATE_TYPE",
"TARGET_OS",
], channels = [
"stable",
] }
[tasks.appflowy-sdk-dev] [tasks.appflowy-sdk-dev]
mac_alias = "appflowy-sdk-dev-macos" mac_alias = "appflowy-sdk-dev-macos"
@ -16,22 +23,41 @@ linux_alias = "appflowy-sdk-dev-linux"
[tasks.appflowy-sdk-dev-android] [tasks.appflowy-sdk-dev-android]
category = "Build" category = "Build"
dependencies = ["env_check"] dependencies = ["env_check"]
run_task = { name = ["setup-crate-type","sdk-build-android", "restore-crate-type"] } run_task = { name = [
"setup-crate-type",
"sdk-build-android",
"restore-crate-type",
] }
[tasks.appflowy-sdk-dev-macos] [tasks.appflowy-sdk-dev-macos]
category = "Build" category = "Build"
dependencies = ["env_check"] dependencies = ["env_check"]
run_task = { name = ["setup-crate-type","sdk-build", "post-desktop", "restore-crate-type"] } run_task = { name = [
"setup-crate-type",
"sdk-build",
"post-desktop",
"restore-crate-type",
] }
[tasks.appflowy-sdk-dev-windows] [tasks.appflowy-sdk-dev-windows]
category = "Build" category = "Build"
dependencies = ["env_check"] dependencies = ["env_check"]
run_task = { name = ["setup-crate-type","sdk-build", "post-desktop", "restore-crate-type"] } run_task = { name = [
"setup-crate-type",
"sdk-build",
"post-desktop",
"restore-crate-type",
] }
[tasks.appflowy-sdk-dev-linux] [tasks.appflowy-sdk-dev-linux]
category = "Build" category = "Build"
dependencies = ["env_check"] dependencies = ["env_check"]
run_task = { name = ["setup-crate-type","sdk-build", "post-desktop", "restore-crate-type"] } run_task = { name = [
"setup-crate-type",
"sdk-build",
"post-desktop",
"restore-crate-type",
] }
# #
@ -90,7 +116,12 @@ script_runner = "@duckscript"
description = "Build flowy sdk in release mode" description = "Build flowy sdk in release mode"
category = "Build" category = "Build"
dependencies = ["env_check"] dependencies = ["env_check"]
run_task = { name = ["setup-crate-type","sdk-release-build", "post-desktop", "restore-crate-type"] } run_task = { name = [
"setup-crate-type",
"sdk-release-build",
"post-desktop",
"restore-crate-type",
] }
# #
[tasks.sdk-release-build] [tasks.sdk-release-build]
@ -167,9 +198,19 @@ script_runner = "@duckscript"
[tasks.build-test-lib] [tasks.build-test-lib]
category = "Build" category = "Build"
dependencies = ["env_check"] dependencies = ["env_check"]
run_task = { name = ["setup-test-crate-type","build-test-backend", "copy-to-sandbox-folder", "restore-test-crate-type"] } run_task = { name = [
"setup-test-crate-type",
"build-test-backend",
"copy-to-sandbox-folder",
"restore-test-crate-type",
] }
[tasks.build-test-backend] [tasks.build-test-backend]
mac_alias = "build-test-backend-default"
windows_alias = "build-test-backend-widnows"
linux_alias = "build-test-backend-default"
[tasks.build-test-backend-default]
private = true private = true
script = [ script = [
""" """
@ -182,7 +223,39 @@ script = [
] ]
script_runner = "@shell" script_runner = "@shell"
[tasks.build-test-backend-widnows]
private = true
script = [
"""
cd rust-lib/
rustup show
echo cargo build --package=dart-ffi --target ${TEST_COMPILE_TARGET} --features "${FEATURES}"
cargo build --package=dart-ffi --target ${TEST_COMPILE_TARGET} --features "${FEATURES}"
cd ../
""",
]
script_runner = "@shell"
[tasks.copy-to-sandbox-folder] [tasks.copy-to-sandbox-folder]
mac_alias = "copy-to-sandbox-folder-default"
windows_alias = "copy-to-sandbox-folder-windows"
linux_alias = "copy-to-sandbox-folder-default"
[tasks.copy-to-sandbox-folder-windows]
private = true
script = [
"""
# Copy the flowy_sdk lib to system temp directory for flutter unit test.
lib = set ${LIB_NAME}.${TEST_LIB_EXT}
dest = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/.sandbox/${lib}
rm ${dest}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${TEST_COMPILE_TARGET}/${TEST_BUILD_FLAG}/${lib} \
${dest}
""",
]
script_runner = "@duckscript"
[tasks.copy-to-sandbox-folder-default]
private = true private = true
script = [ script = [
""" """

View File

@ -1,5 +1,23 @@
[tasks.dart_unit_test] [tasks.dart_unit_test.macos]
description = "Run flutter unit tests"
script = '''
cargo make --profile test-macos dart_unit_test_inner
'''
[tasks.dart_unit_test.linux]
description = "Run flutter unit tests"
script = '''
cargo make --profile test-linux dart_unit_test_inner
'''
[tasks.dart_unit_test.windows]
description = "Run flutter unit tests"
script = '''
cargo make --profile test-windows dart_unit_test_inner
'''
[tasks.dart_unit_test_inner]
dependencies = ["build-test-lib"] dependencies = ["build-test-lib"]
description = "Run flutter unit tests" description = "Run flutter unit tests"
script = ''' script = '''