From 7d7705229984bc469a76cb34685b1b602f234355 Mon Sep 17 00:00:00 2001 From: Federico Pellegrin Date: Thu, 9 Dec 2021 09:11:39 +0100 Subject: [PATCH] eclipse: add possibility to add custom targets execution Make it easy to add custom target executions in the automatic eclipse configuration generation, for example to call other standard waf targets from other tools or with specific options. --- playground/eclipse/wscript | 1 + waflib/extras/eclipse.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/playground/eclipse/wscript b/playground/eclipse/wscript index 7d53ab79..f7601a5a 100644 --- a/playground/eclipse/wscript +++ b/playground/eclipse/wscript @@ -54,6 +54,7 @@ def options(opt): def configure(conf): + conf.env.ECLIPSE_EXTRA_TARGETS = ['test', 'lint', 'foo --bar'] conf.load('eclipse') # We recurse configurations in our submodules conf.recurse(module_list) diff --git a/waflib/extras/eclipse.py b/waflib/extras/eclipse.py index ef057e8a..8e61007f 100644 --- a/waflib/extras/eclipse.py +++ b/waflib/extras/eclipse.py @@ -10,6 +10,9 @@ Usage: def options(opt): opt.load('eclipse') +To add additional targets beside standard ones (configure, dist, install, check) +the environment ECLIPSE_EXTRA_TARGETS can be set (ie. to ['test', 'lint', 'docs']) + $ waf configure eclipse """ @@ -400,6 +403,8 @@ class eclipse(Build.BuildContext): addTargetWrap('dist', False) addTargetWrap('install', False) addTargetWrap('check', False) + for addTgt in getattr(self.env, 'ECLIPSE_EXTRA_TARGETS', []): + addTargetWrap(addTgt, False) storageModule = self.add(doc, cproject, 'storageModule', {'moduleId': 'cdtBuildSystem',