Skip to content

Commit 23d1a1c

Browse files
committed
Switched to ufbt
Signed-off-by: paulober <[email protected]>
1 parent e9f02f8 commit 23d1a1c

29 files changed

+380
-1885
lines changed

package.json

+9-53
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,14 @@
3030
},
3131
{
3232
"command": "flipper-app-dev.clean",
33-
"title": "Delete all installed SDKs (also removes all flipper app projects)",
33+
"title": "Clean sdk management",
3434
"category": "Flipper App Development"
3535
},
3636
{
3737
"command": "flipper-app-dev.famEdit.new",
3838
"title": "New Flipper Application Manifest",
3939
"category": "Flipper App Development"
4040
},
41-
{
42-
"command": "flipper-app-dev.installSDK",
43-
"title": "Install SDK",
44-
"category": "Flipper App Development"
45-
},
46-
{
47-
"command": "flipper-app-dev.deleteSDK",
48-
"title": "Delete SDK",
49-
"category": "Flipper App Development",
50-
"icon": "$(trash)"
51-
},
5241
{
5342
"command": "flipper-app-dev.buildFap",
5443
"title": "Build Flipper Application Package",
@@ -66,24 +55,6 @@
6655
"title": "Open Flipper Serial Console",
6756
"category": "Flipper App Development",
6857
"icon": "$(console)"
69-
},
70-
{
71-
"command": "flipper-app-dev.fbtExecutable",
72-
"title": "Get FBT Executable path",
73-
"category": "Flipper App Development",
74-
"enablement": "!isQuickOpen"
75-
},
76-
{
77-
"command": "flipper-app-dev.scriptsFolder",
78-
"title": "Get Scripts Folder path of selected SDK",
79-
"category": "Flipper App Development",
80-
"enablement": "!isQuickOpen"
81-
},
82-
{
83-
"command": "flipper-app-dev.buildFolder",
84-
"title": "Get Build Folder path of selected SDK",
85-
"category": "Flipper App Development",
86-
"enablement": "!isQuickOpen"
8758
}
8859
],
8960
"languages": [
@@ -111,7 +82,7 @@
11182
"displayName": "Flipper Application Manifest",
11283
"selector": [
11384
{
114-
"filenamePattern": "application.fam"
85+
"filenamePattern": "application*.fam"
11586
}
11687
]
11788
}
@@ -129,32 +100,17 @@
129100
"flipper-app-dev-activity-bar": [
130101
{
131102
"id": "flipper-app-dev-quick-access",
132-
"name": "Quick Access",
133-
"type": "tree"
134-
},
135-
{
136-
"id": "flipper-app-dev-sdk-management",
137-
"name": "SDK Management",
103+
"name": "SDK Branch",
138104
"type": "tree"
139105
}
140106
]
141107
},
142-
"menus": {
143-
"view/title": [
144-
{
145-
"command": "flipper-app-dev.installSDK",
146-
"when": "view == flipper-app-dev-sdk-management",
147-
"group": "navigation"
148-
}
149-
],
150-
"view/item/context": [
151-
{
152-
"command": "flipper-app-dev.deleteSDK",
153-
"when": "view == flipper-app-dev-sdk-management && viewItem == sdkItem",
154-
"group": "inline"
155-
}
156-
]
157-
}
108+
"viewsWelcome": [
109+
{
110+
"view": "flipper-app-dev-quick-access",
111+
"contents": "No Flipper App found in this workspace.\n[Create new Flipper App](command:flipper-app-dev.newApp)"
112+
}
113+
]
158114
},
159115
"activationEvents": [
160116
"workspaceContains:application.fam"
File renamed without changes.
File renamed without changes.
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import {
2+
ProviderResult,
3+
ThemeIcon,
4+
TreeDataProvider,
5+
TreeItem,
6+
TreeItemCollapsibleState,
7+
} from "vscode";
8+
import { UfbtSDKBranch } from "../helper/ufbt.mjs";
9+
import { EXTENSION_NAME } from "../constants.mjs";
10+
import SwitchSDKCommand from "../commands/switchSDK.mjs";
11+
12+
export class SDKBranch extends TreeItem {
13+
constructor(
14+
public readonly label: string,
15+
public readonly branch: UfbtSDKBranch,
16+
public readonly collapsibleState: TreeItemCollapsibleState
17+
) {
18+
super(label, collapsibleState);
19+
20+
this.tooltip = `Switch to ${this.branch} SDK`;
21+
this.description = this.branch;
22+
this.iconPath = new ThemeIcon("git-branch");
23+
}
24+
25+
contextValue = "sdkBranch";
26+
}
27+
28+
export class FlipperAppDevProvider implements TreeDataProvider<SDKBranch> {
29+
constructor(private workspaceRoot?: string) {}
30+
31+
getTreeItem(element: SDKBranch): TreeItem {
32+
element.command = {
33+
command: `${EXTENSION_NAME}.${SwitchSDKCommand.id}`,
34+
title: "Switch SDK",
35+
arguments: [element.branch],
36+
};
37+
return element;
38+
}
39+
40+
getChildren(element?: SDKBranch | undefined): ProviderResult<SDKBranch[]> {
41+
if (element || !this.workspaceRoot) {
42+
return;
43+
}
44+
45+
return [
46+
new SDKBranch(
47+
"Release",
48+
UfbtSDKBranch.release,
49+
TreeItemCollapsibleState.None
50+
),
51+
new SDKBranch("Beta", UfbtSDKBranch.rc, TreeItemCollapsibleState.None),
52+
new SDKBranch(
53+
"Development",
54+
UfbtSDKBranch.dev,
55+
TreeItemCollapsibleState.None
56+
),
57+
];
58+
}
59+
}

src/activitybar/quickAccess.mts

-139
This file was deleted.

src/activitybar/sdkManagement.mts

-63
This file was deleted.

0 commit comments

Comments
 (0)