How to use Rake::PackageTask to create a zip file

I found out that the easiest way to build a WordPress plugin is using a rake task. In fact, you can use Rake::PackageTask to create a zip file. However, there is very little documentation about how to do it in practice. Here is my solution.

  1. (destroy and) create a folder to hold just the needed files
  2. copy the (possibly transformed) needed files to that folder
  3. compress the folder

Here is my Rakefile:

Here are the tasks it creates:

Here is how you can use it:

Here is what you get:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.