Skip to content

Commit 451f425

Browse files
authored
Make clean_microros target be listed in IDE (#23)
* Fix idedata target * Add clean_microros target to global_env
1 parent 9f8da45 commit 451f425

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

extra_script.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def clean_microros_callback(*args, **kwargs):
5858
print("micro-ROS library cleaned!")
5959
os._exit(0)
6060

61-
env.AddPlatformTarget("clean_microros", None, clean_microros_callback)
61+
global_env.AddCustomTarget("clean_microros", None, clean_microros_callback, title="Clean Micro-ROS", description="Clean Micro-ROS build environment")
6262

6363
def build_microros(*args, **kwargs):
6464
##############################
@@ -144,9 +144,6 @@ def build_microros(*args, **kwargs):
144144

145145
from SCons.Script import COMMAND_LINE_TARGETS
146146

147-
# Do not run extra script when IDE fetches C/C++ project metadata
148-
if set(["_idedata", "idedata"]) & set(COMMAND_LINE_TARGETS):
149-
os._exit(0)
150-
# Do not build library on clean_microros command
151-
elif "clean_microros" not in COMMAND_LINE_TARGETS:
147+
# Do not build library on clean_microros target or when IDE fetches C/C++ project metadata
148+
if set(["clean_microros", "_idedata", "idedata"]).isdisjoint(set(COMMAND_LINE_TARGETS)):
152149
build_microros()

0 commit comments

Comments
 (0)