Allow defining namespaces in multiple files instead of just one. #144

Closed
chakrit opened this Issue Aug 10, 2012 · 1 comment

Projects

None yet

1 participant

@chakrit
Contributor
chakrit commented Aug 10, 2012

Currently if I do this in my Jakefile:

namespace('x', function() {
  desc('one doc');
  task('one', function() { });
});

And then I have the same namespace defined in jakelib/x.jake:

namespace('x', function() {
  desc('two doc');
  task('two', function() { });
});

I can invoke jake x:two but not jake x:one presumably because the redefinition in the jakelib file is done after the original Jakefile so it overrides the namespace definition.

However doing jake -T still list both tasks:

jake x:one   # one doc
jake x:two   # two doc

I think the better (correct?) behavior should be to add those tasks to the existing namespace instead of replacing them if it's already defined.

Or atleast there should be a warning that the previous tasks definitions would be replaced, or that the previous task shouldn't be listed when doing jake -T

Will see if I can help with a PR this coming weekends.

@chakrit chakrit pushed a commit to chakrit/jake that referenced this issue Aug 17, 2012
Chakrit Wichian Allow multiple namespace() calls with the same name to not override e…
…ach other. #144

The original behavior is that calling namespace() multiple times with
the same name will cause the old namespace to be overridden.

This commit makes it so that instead of the old namespace being
overridden, it is extended. This is the same as when calling
task() multiple times.
d315cfa
@chakrit chakrit pushed a commit to chakrit/jake that referenced this issue Aug 17, 2012
Chakrit Wichian Add some tests for multiple namespace() calls. #144 e0b2440
@chakrit
Contributor
chakrit commented Aug 17, 2012

Also, PR #149

@chakrit chakrit closed this Aug 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment