Browse Source

Skip scripts during 'platformio init' (#21643)

Scott Lahteine 3 years ago
parent
commit
e8af38cc2d
No account linked to committer's email address

+ 6
- 0
buildroot/share/PlatformIO/scripts/common-cxxflags.py View File

3
 # Convenience script to apply customizations to CPP flags
3
 # Convenience script to apply customizations to CPP flags
4
 #
4
 #
5
 Import("env")
5
 Import("env")
6
+
7
+# Detect that 'vscode init' is running
8
+from SCons.Script import COMMAND_LINE_TARGETS
9
+if "idedata" in COMMAND_LINE_TARGETS:
10
+    env.Exit(0)
11
+
6
 env.Append(CXXFLAGS=[
12
 env.Append(CXXFLAGS=[
7
   "-Wno-register"
13
   "-Wno-register"
8
   #"-Wno-incompatible-pointer-types",
14
   #"-Wno-incompatible-pointer-types",

+ 6
- 1
buildroot/share/PlatformIO/scripts/common-dependencies-post.py View File

2
 # common-dependencies-post.py
2
 # common-dependencies-post.py
3
 # Convenience script to add build flags for Marlin Enabled Features
3
 # Convenience script to add build flags for Marlin Enabled Features
4
 #
4
 #
5
-
6
 Import("env")
5
 Import("env")
6
+
7
+# Detect that 'vscode init' is running
8
+from SCons.Script import COMMAND_LINE_TARGETS
9
+if "idedata" in COMMAND_LINE_TARGETS:
10
+    env.Exit(0)
11
+
7
 Import("projenv")
12
 Import("projenv")
8
 
13
 
9
 def apply_board_build_flags():
14
 def apply_board_build_flags():

+ 9
- 4
buildroot/share/PlatformIO/scripts/common-dependencies.py View File

2
 # common-dependencies.py
2
 # common-dependencies.py
3
 # Convenience script to check dependencies and add libs and sources for Marlin Enabled Features
3
 # Convenience script to check dependencies and add libs and sources for Marlin Enabled Features
4
 #
4
 #
5
+Import("env")
6
+
7
+#print(env.Dump())
8
+
9
+# Detect that 'vscode init' is running
10
+from SCons.Script import COMMAND_LINE_TARGETS
11
+if "idedata" in COMMAND_LINE_TARGETS:
12
+    env.Exit(0)
13
+
5
 import subprocess,os,re
14
 import subprocess,os,re
6
 
15
 
7
 PIO_VERSION_MIN = (5, 0, 3)
16
 PIO_VERSION_MIN = (5, 0, 3)
31
 from platformio.package.meta import PackageSpec
40
 from platformio.package.meta import PackageSpec
32
 from platformio.project.config import ProjectConfig
41
 from platformio.project.config import ProjectConfig
33
 
42
 
34
-Import("env")
35
-
36
-#print(env.Dump())
37
-
38
 try:
43
 try:
39
 	verbose = int(env.GetProjectOption('custom_verbose'))
44
 	verbose = int(env.GetProjectOption('custom_verbose'))
40
 except:
45
 except:

+ 7
- 0
buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py View File

1
 #
1
 #
2
 # copy_marlin_variant_to_framework.py
2
 # copy_marlin_variant_to_framework.py
3
 #
3
 #
4
+Import("env")
5
+
6
+# Detect that 'vscode init' is running
7
+from SCons.Script import COMMAND_LINE_TARGETS
8
+if "idedata" in COMMAND_LINE_TARGETS:
9
+    env.Exit(0)
10
+
4
 import os,shutil
11
 import os,shutil
5
 from SCons.Script import DefaultEnvironment
12
 from SCons.Script import DefaultEnvironment
6
 from platformio import util
13
 from platformio import util

+ 7
- 1
buildroot/share/PlatformIO/scripts/preflight-checks.py View File

2
 # preflight-checks.py
2
 # preflight-checks.py
3
 # Check for common issues prior to compiling
3
 # Check for common issues prior to compiling
4
 #
4
 #
5
-import os,re,sys
6
 Import("env")
5
 Import("env")
7
 
6
 
7
+# Detect that 'vscode init' is running
8
+from SCons.Script import COMMAND_LINE_TARGETS
9
+if "idedata" in COMMAND_LINE_TARGETS:
10
+    env.Exit(0)
11
+
12
+import os,re,sys
13
+
8
 def get_envs_for_board(board):
14
 def get_envs_for_board(board):
9
 	with open(os.path.join("Marlin", "src", "pins", "pins.h"), "r") as file:
15
 	with open(os.path.join("Marlin", "src", "pins", "pins.h"), "r") as file:
10
 
16
 

Loading…
Cancel
Save