瀏覽代碼

[2.0.x] Add Sublime support for Auto build, minor Auto-build update (#10809)

Bob Kuhn 6 年之前
父節點
當前提交
22e0691a70

+ 7
- 0
buildroot/share/atom/auto_build.py 查看文件

@@ -69,6 +69,13 @@
69 69
 import sys
70 70
 import os
71 71
 
72
+pwd = os.getcwd()    # make sure we're executing from the correct directory level
73
+pwd = pwd.replace('\\', '/')
74
+if 0 <= pwd.find('buildroot/share/atom'):
75
+  pwd = pwd[ : pwd.find('buildroot/share/atom')]
76
+  os.chdir(pwd)
77
+print 'pwd: ', pwd
78
+
72 79
 num_args = len(sys.argv)
73 80
 if num_args > 1:
74 81
   build_type = str(sys.argv[1])

+ 40
- 0
buildroot/share/sublime/auto_build_sublime_menu/000_read_me.txt 查看文件

@@ -0,0 +1,40 @@
1
+Overview:
2
+1) Install Sublime
3
+2) Install Deviot  (?optional?)
4
+3) Install WebDevShell (this will execute the auto-build script)
5
+4) Copy the menu configuration to the proper Sublime directory
6
+5) Add platformio to your path (usually not needed)
7
+
8
+
9
+Sublime with autobuild
10
+  Tools
11
+    Install Package Control
12
+  Tools
13
+    Command Palette
14
+      Package Control: Install Package
15
+          type in deviot and click on it
16
+  Tools
17
+    Command Palette
18
+      Package Control: Install Package
19
+          type in WebDevShell and click on it
20
+
21
+  in Sublime, open Marlin directory with "platformio.ini" in it
22
+
23
+  starting in the top level directory, go to the folder "Buildroot/shared/Sublime"
24
+    copy the folder "auto_build_sublime_menu" and contents to:
25
+      Windows
26
+       \Users\your_user_name\AppData\Roaming\Sublime Text 3\Packages
27
+      Linux
28
+        /home/your_user_name/.config/sublime-text-3/Packages/User
29
+      macOS (Click on the Finder's 'Go' menu and hold down Option to open...)
30
+        ~/Library/Application Support/Sublime Text 3/Packages/User
31
+
32
+The menu should now be visible
33
+
34
+If you get an error message that says "file not found" and  "subprocess.Popen(['platformio' ... "
35
+then you'll need to add platformio to your path.
36
+  macOS
37
+      sudo nano /etc/paths
38
+        add these to the bottom
39
+            /Users/bob/.platformio
40
+            /Users/bob/.platformio/penv/bin

+ 66
- 0
buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu 查看文件

@@ -0,0 +1,66 @@
1
+[
2
+
3
+    {
4
+        "caption": "Auto Build",
5
+        "children": [
6
+            {
7
+                "caption": "PIO Build",
8
+                "command": "webdevshell",
9
+                "args": {
10
+                    "command": "python buildroot/share/atom/auto_build.py build"
11
+                }
12
+            },
13
+            {
14
+                "caption": "PIO Clean",
15
+                "command": "webdevshell",
16
+                "args": {
17
+                    "command": "python buildroot/share/atom/auto_build.py clean"
18
+                }
19
+            },
20
+            {
21
+                "caption": "PIO Upload",
22
+                "command": "webdevshell",
23
+                "args": {
24
+                    "command": "python buildroot/share/atom/auto_build.py  upload"
25
+                }
26
+            },
27
+            {
28
+                "caption": "PIO Upload (traceback)",
29
+                "command": "webdevshell",
30
+                "args": {
31
+                    "command": "python buildroot/share/atom/auto_build.py  traceback"
32
+                }
33
+            },
34
+            {
35
+                "caption": "PIO Upload using Programmer",
36
+                "command": "webdevshell",
37
+                "args": {
38
+                    "command": "python buildroot/share/atom/auto_build.py  program"
39
+                }
40
+            },
41
+            {
42
+                "caption": "PIO Test",
43
+                "command": "webdevshell",
44
+                "args": {
45
+                    "command": "python buildroot/share/atom/auto_build.py  test"
46
+                }
47
+            },
48
+            {
49
+                "caption": "PIO Debug",
50
+                "command": "webdevshell",
51
+                "args": {
52
+                    "command": "python buildroot/share/atom/auto_build.py  debug"
53
+                }
54
+            },
55
+            {
56
+                "caption": "PIO Remote",
57
+                "command": "webdevshell",
58
+                "args": {
59
+                    "command": "python buildroot/share/atom/auto_build.py  remote"
60
+                }
61
+            }
62
+        ],
63
+        "id": "AutoBuild",
64
+        "mnemonic": "A"
65
+    }
66
+]

Loading…
取消
儲存