Browse Source

chore: support compile af on frontend/ directory

appflowy 3 years ago
parent
commit
aecf29ddca

+ 44 - 0
frontend/.vscode/launch.json

@@ -0,0 +1,44 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "app_flowy",
+            "request": "launch",
+            "program": "./lib/main.dart",
+            "type": "dart",
+            "preLaunchTask": "build_flowy_sdk",
+            "env":{
+                "RUST_LOG":"info",
+            },
+            "cwd": "${workspaceRoot}/app_flowy"
+        },
+        {
+            "name": "app_flowy(trace)",
+            "request": "launch",
+            "program": "./lib/main.dart",
+            "type": "dart",
+            "preLaunchTask": "build_flowy_sdk",
+            "env":{
+                "RUST_LOG":"trace",
+            },
+            "cwd": "${workspaceRoot}/app_flowy"
+        },
+        {
+            "name": "app_flowy (profile mode)",
+            "request": "launch",
+            "type": "dart",
+            "flutterMode": "profile"
+        },
+        {
+            "name": "Generate Language Files",
+            "request": "launch",
+            "program": "./lib/main.dart",
+            "type": "dart",
+            "preLaunchTask": "Generate Language Files",
+            "cwd": "${workspaceRoot}/app_flowy/"
+        },
+    ]
+}

+ 26 - 0
frontend/.vscode/settings.json

@@ -0,0 +1,26 @@
+{
+    "[dart]": {
+        "editor.formatOnSave": true,
+        "editor.formatOnType": true,
+        "editor.rulers": [
+            120
+        ],
+        "editor.selectionHighlight": false,
+        "editor.suggest.snippetsPreventQuickSuggestions": false,
+        "editor.suggestSelection": "first",
+        "editor.tabCompletion": "onlySnippets",
+        "editor.wordBasedSuggestions": false
+    },
+    "svgviewer.enableautopreview": true,
+    "svgviewer.previewcolumn": "Active",
+    "svgviewer.showzoominout": true,
+    "editor.wordWrapColumn": 120,
+    "editor.minimap.maxColumn": 140,
+    "prettier.printWidth": 140,
+    "editor.wordWrap": "wordWrapColumn",
+    "dart.lineLength": 120,
+    "files.associations": {
+        "*.log.*": "log"
+    },
+    "editor.formatOnSave": true,
+}

+ 75 - 0
frontend/.vscode/tasks.json

@@ -0,0 +1,75 @@
+{
+	"version": "2.0.0",
+	// https://code.visualstudio.com/docs/editor/tasks
+	// https://gist.github.com/deadalusai/9e13e36d61ec7fb72148
+	// ${workspaceRoot}: the root folder of the team
+	// ${file}: the current opened file
+	// ${fileBasename}: the current opened file's basename
+	// ${fileDirname}: the current opened file's dirname
+	// ${fileExtname}: the current opened file's extension
+	// ${cwd}: the current working directory of the spawned process
+	"tasks": [
+		{
+			"label": "build_flowy_sdk",
+			"type": "shell",
+			"command": "sh ./scripts/build_sdk.sh",
+			"windows": {
+				"options": {
+					"env": {
+						"FLOWY_DEV_ENV": "Windows",
+					},
+					"shell": {
+						"executable": "cmd.exe",
+						"args": [
+							"/d",
+							"/c",
+							".\\scripts\\build_sdk.cmd"
+						]
+					}
+				}
+			},
+			"linux": {
+				"options": {
+					"env": {
+						"FLOWY_DEV_ENV": "Linux-x86",
+					}
+				},
+			},
+			"osx": {
+				"options": {
+					"env": {
+						"FLOWY_DEV_ENV": "macOS",
+					}
+				},
+			},
+			"group": "build",
+			"options": {
+				"cwd": "${workspaceFolder}"
+			},
+			// "problemMatcher": [
+			//     "$rustc"
+			// ],
+		},
+		{
+			"label": "Generate Language Files",
+			"type": "shell",
+			"command": "sh ./scripts/generate_language_files.sh",
+			"windows": {
+				"options": {
+					"shell": {
+						"executable": "cmd.exe",
+						"args": [
+							"/d",
+							"/c",
+							".\\scripts\\generate_language_files.cmd"
+						]
+					}
+				}
+			},
+			"group": "build",
+			"options": {
+				"cwd": "${workspaceFolder}"
+			},
+		}
+	]
+}

+ 1 - 1
frontend/rust-lib/flowy-test/Cargo.toml

@@ -6,7 +6,7 @@ edition = "2018"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
-flowy-sdk = { path = "../flowy-sdk"}
+flowy-sdk = { path = "../flowy-sdk", default-features = false }
 flowy-user = { path = "../flowy-user"}
 flowy-net = { path = "../flowy-net"}
 flowy-folder = { path = "../flowy-folder", default-features = false}