Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use specific targets rather than the full task #4

Closed
davidtheclark opened this issue Mar 3, 2014 · 10 comments
Closed

Use specific targets rather than the full task #4

davidtheclark opened this issue Mar 3, 2014 · 10 comments

Comments

@davidtheclark
Copy link
Contributor

It doesn't look to me like there's a way to use a specific Grunt target rather than the full task -- the equivalent of running grunt assemble:dev rather than just grunt assemble (which runs all the assemble targets).

I would like to be able to do this. What do you think?

At first I was having a hard time finding a way via the Grunt API to get what would be needed -- but then I found that the grunt.config.get() method could be used to get the configuration object, whose keys would be target names. So that's one way, unless you know of something better.

@maxov
Copy link
Owner

maxov commented Mar 30, 2014

It may be possible to access tasks on demand by modifying the gulp object(so these targets would be requested from grunt on demand), or like you said it may be possible to find these targets. I do know that some Grunt API browsing will be necessary.

@davidtheclark
Copy link
Contributor Author

I'm finally getting around to working on a pull request for this issue (https://github.com/davidtheclark/gulp-grunt). I have the functionality working with a simple use case:

gulp.task('style', function() {
  gulp.run('grunt-sass');
});
gulp.task('styleFirst', function() {
  gulp.run('grunt-sass:first');
});
gulp.task('styleSecond', function() {
  gulp.run('grunt-sass:second');
});

All three of those work, the first running both first and second targets, and the next ones running only their specific targets.

However, I'm not very experienced as a Node programmer and was wondering if you could help me with the testing. When I run gulp test (without having changed any of the test files) I get a

events.js:72
        throw er; // Unhandled 'error' event
Error: spawn ENOENT
    at errnoException (child_process.js:998:11)
    at Process.ChildProcess._handle.onexit (child_process.js:789:34)

... and I'm not really sure what to do about that. Any advice?

So although I have a use-case working I haven't yet been able to test that this new functionality didn't break your other tests, and haven't yet added any new tests for it.

Would you like me to submit the pull request in this current state, or do you have a suggestion for what I should do next? Thanks!

@maxov
Copy link
Owner

maxov commented May 25, 2014

Already merged, and I think I fixed the issue. Any chance you develop on windows?

@davidtheclark
Copy link
Contributor Author

Great!

No, I don't develop on Windows.

@maxov
Copy link
Owner

maxov commented May 25, 2014

Would you mind pulling it down and running the test suite? I am still unsure if it works on any machine except mine.

@maxov
Copy link
Owner

maxov commented May 25, 2014

If everything works, you should add docs to the README.md and make a pull request. I'm not sure exactly how this feature works.

@davidtheclark
Copy link
Contributor Author

Unfortunately, the test suite doesn't seem to work on my machine still.

But in the meantime I submitted a PR in which I added a couple of lines to the Readme illustrating how I envisioned this functionality working. Please let me know if I need to clarify, or if it is not working for you the way it is supposed to.

@maxov
Copy link
Owner

maxov commented May 25, 2014

It's strange that it's not working on your machine. Travis handles it just fine.

@davidtheclark
Copy link
Contributor Author

If Travis and you handle it and nobody else complains, may be a problem with my own installation and not a problem with the plugin.

@maxov
Copy link
Owner

maxov commented Nov 1, 2014

I'm going to go ahead and close this because I have not gotten complaints about specific task targets.

@maxov maxov closed this as completed Nov 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants