From daa0c135e165096d0791b9148490279d49ccd687 Mon Sep 17 00:00:00 2001 From: fedepell Date: Wed, 17 Jan 2018 15:32:29 +0100 Subject: [PATCH] eclipse.py: support also if passed srcdir is a Node or a list of directories (which are valid inputs for javaw.py) --- waflib/extras/eclipse.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/waflib/extras/eclipse.py b/waflib/extras/eclipse.py index 83eb94bb..d52d0991 100644 --- a/waflib/extras/eclipse.py +++ b/waflib/extras/eclipse.py @@ -14,7 +14,7 @@ $ waf configure eclipse """ import sys, os -from waflib import Utils, Logs, Context, Build, TaskGen, Scripting, Errors +from waflib import Utils, Logs, Context, Build, TaskGen, Scripting, Errors, Node from xml.dom.minidom import Document STANDARD_INCLUDES = [ '/usr/local/include', '/usr/include' ] @@ -90,11 +90,18 @@ class eclipse(Build.BuildContext): java_src = tg.path.relpath() java_srcdir = getattr(tg, 'srcdir', None) if java_srcdir: - if java_src == '.': - java_src = java_srcdir - else: - java_src += os.sep + java_srcdir - javasrcpath.append(java_src) + if isinstance(java_srcdir, Node.Node): + java_srcdir = [java_srcdir] + for x in Utils.to_list(java_srcdir): + if isinstance(x, Node.Node): + x = x.name + if java_src == '.': + this_src = x + else: + this_src = java_src + os.sep + x + javasrcpath.append(this_src) + else: + javasrcpath.append(java_src) hasjava = True tg.post()