Giter Site home page Giter Site logo

grunt-parallel's People

Contributors

alfred-nsh avatar dylang avatar iammerrick avatar neojski avatar steveoh avatar vernonk avatar vojtajina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-parallel's Issues

Verbose mode ignored

$ grunt -v parallel 

Parallel does not pass on the verbose flag to tasks, thus the verbose output is not displayed.

config style breaks grunt --verbose option

I've created gruntjs/grunt/issues/705 because the way config is done in Grunt-Parallel isn't compatible with the --verbose option.

If Grunt isn't going to change how they work then Grunt-Parallel's config might need to change to conform to their style. This is a simple change - options just need to be inside an options object.

Fail fast deactivation

I have a CPU intensive task (task1) and a Network intensive task (task2), which I want to run in parallel. Now, if task1 fails, task2 is not killed, but grunt exits.

Is there an option to:

  • Either let all tasks fully complete their job (preferred and easier)
  • Or have some sort of finally clause

I am happy to try open a pull request if any of the choices are part of the philosophy of the library.

Update to support grunt 1.0

Hi @iammerrick

Looks like you've already merged the PR with the update needed (#40)
Would you mind publishing a new version at npm?

Also looks like apart from peerDependency, you also list grunt as a regular dependency - and this one is still the old version.
To me it seems that the latter can be safely dropped at all - it doesn't seem to be used.
The PR with the proposed change: #42

Thanks!

Why not also series?

Hi there,

Right now, "tasks" is only an array of tasks that will be run in parallel. But what if, in some cases, I would like to run in parallel some series of tasks? As for the syntax, "tasks" could also be an object or array of arrays, and then run those "sub-tasks" in series. For example:

parallel: {
  series: {
    options: { grunt: true },
    tasks: [
      ["fast", "fast"],
      ["fast", "block", "block"],
      "fast"
    ]
  }
}

In this case, there would be 3 parallel process, one running twice "fast" in series, one running "fast" and then twice "block", and finally one running only once "fast".

It would be totally backward compatible. What do you thing?

Mysteriously crashes on node v0.10.x

Here's the relevant command/snippet from AngularJS's build:

grunt --stack parallel:travis --reporters dots --browsers SL_Chrome

#
# lots o stuff
#

Running "test:end2end" (test) task
node: ../deps/uv/src/unix/stream.c:494: uv__server_io: Assertion `events == 1' failed.
    ERROR
    Warning: Task "parallel:travis" failed.� Use --force to continue.
Error: Task "parallel:travis" failed.
    at Task.<anonymous> (/home/travis/build/btford/angular.js/node_modules/grunt/lib/util/task.js:197:15)
    at null._onTimeout (/home/travis/build/btford/angular.js/node_modules/grunt/lib/util/task.js:225:33)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

See build here: https://travis-ci.org/btford/angular.js/builds/9962771#L1566

Seems like the issue is with grunt.util.spawn's handling of stream direction.

0.4.0 breaks with "no method 'flags'" error

After upgrading to 0.4.0 I encountered this error:

Verifying property parallel.web exists in config...OK
File: [no files]
Options: grunt=false, stream=false
Warning: Object #<Object> has no method 'flags' Use --force to continue.

I saw a commit related to flags by @vernonk do i need to change my config?

grunt.config properties are not shared across spawned tasks

Parallel works great for shaving a few seconds off intensive tasks like grunt-contrib-uglify, but it has an issue right now where grunt.config properties that are set in a previous task are not shared across the spawned tasks.

I ran into this when attempting to inject the git-sha from a shell command into my banner during uglification, here's the grunt configuration:

module.exports = (grunt) ->

  grunt.loadTasks "tasks"

  grunt.loadNpmTasks "grunt-contrib-concat"
  grunt.loadNpmTasks "grunt-contrib-uglify"
  grunt.loadNpmTasks "grunt-parallel"

  # Project configuration.

  config =
    # Metadata.
    pkg: grunt.file.readJSON("package.json")
    banner: "/*! sha: <%= sha %> */\n"

    # Task configuration.
    git_rev_parse:
      prop: "sha"

    concat:
      options:
        banner: "<%= banner %>"
        stripBanners: true

      bundle:
        files:
          "dist/app.js": ["vendor/**/*.js", "app/**/*.js"]

    parallel:
      minification:
        tasks: [
          { grunt: true, args: ['uglify:dist'] }
          { grunt: true, args: ['uglify:alternate'] }
        ]

    uglify:
      options:
        banner: "<%= banner %>"

      dist:
        src: "dist/app.js"
        dest: "dist/app.min.js"

      alternate:
        files:
          "dist/other-app.js" : [
            "dist/app.js"
            "other-things/**/*.js"
          ]

  grunt.initConfig(config)
  grunt.registerTask "default", ["git_rev_parse", "concat", "parallel"]

And here's my git_rev_parse task:

module.exports = (grunt) ->

  grunt.registerTask "git_rev_parse", "Git revision parse", ->

    property = grunt.config("git_rev_parse").prop
    done = @async()
    gitRevParseCommand =
      cmd: "git"
      args: "rev-parse --short HEAD".split(" ")

    writesGitRevision = (err, result) ->
      if err
        grunt.log.error(err)
        return done(false)

      grunt.config property, result.stdout
      grunt.log.write "#{gitRevParseCommand.cmd} #{gitRevParseCommand.args.join(" ")}: "
      grunt.log.ok result.stdout
      done()

    grunt.util.spawn(gitRevParseCommand, writesGitRevision)

Which yields the following:

screen shot 2013-10-13 at 6 29 08 pm

This workflow works fine if I simply setup my default task to use uglify directly, as values persisted to grunt.config in previous tasks will be present in memory when subsequent tasks execute:

screen shot 2013-10-13 at 6 31 59 pm

screen shot 2013-10-13 at 6 35 24 pm

How to pass in a option or cli

I need to pass in --grep = 'test name' to my task mochaTest:android. How do I do that?
I've been trying this for a while and tried following.
tasks:[{
grunt:true,
args:['mochaTest:android'],
options: ['--grep=test_names'],
}, {
grunt:true,
args:['mochaTest:android'],
options:['--grep=test_names'],
}]
}

tasks:[{
grunt:true,
args:['mochaTest:android --grep='test_name'],
}, {
grunt:true,
args:['mochaTest:android'],
}]
}

tasks:[{
grunt:true,
args:['mochaTest:android'],
flags: ['--grep=test_names'],
}, {
grunt:true,
args:['mochaTest:android'],
flags:['--grep=test_names'],
}]
}

tasks:[{
grunt:true,
args:['mochaTest:android'],
flags: 'grep=test_names',
}, {
grunt:true,
args:['mochaTest:android'],
flags:'grep=test_names',
}]
}

Make grunt the default

Just an idea.

If I don't specify cmd, then it should be considered as a grunt task (without specifying grunt: true).

Currently without specifying cmd, you get Cannot call method 'charAt' of undefined.

Real time console logging?

I have a situation where I would like to run two tasks in parallel, but I want them to display their output as they are happening.

My actual situation is two watch tasks (different tasks completely) that I need to run in parallel.

Not all parallel tasks complete

I'm running multiple tests in parallel, which are working fine using grunt-parallel, but if one of the tests fails before the others have finished they are abandoned.

I have a proposed solution to this replacing the Q.all call with Q.allSelected and a little logic, that also required the version of Q to be updated.

Perhaps also a flag to give users the choice between exit on first failure or complete all.

pass args and opts to grunt tasks

i have a grunt option that i need to pass to spawned grunt instances. looks like this would be easy to add at about line 49. lets see if i get ambitious and make a pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.