How do I make a Rake Task run after all other tasks? (i.e. a Rake AfterBuild task)

前端 未结 7 984
感动是毒
感动是毒 2021-02-02 12:39

I\'m new to Rake and using it to build .net projects. What I\'m interested in is having a Summary task that prints out a summary of what has been done. I want this task to alw

7条回答
  •  醉话见心
    2021-02-02 13:22

    Apart from the ugly Rake.application.instance_variable_set, you can enhance the last task on the command-line like so:

      last_task = Rake.application.top_level_tasks.last
      Rake::Task[last_task].enhance do
        puts 'after'
      end
    

    That should do exactly what you need to do!

提交回复
热议问题