Problem with Rake's PackageTask


#1

Hello!

I’m trying to add packaging to my rakefile. I copied the example code
from http://rake.rubyforge.org/classes/Rake/PackageTask.html, that’s it:

require ‘rake/packagetask’

Rake::PackageTask.new(“rake”, “1.2.3”) do |p|
p.need_tar = true
p.package_files.include(“lib/**/*.rb”)
end

but when I run rake --tasks, there are still no tasks related to
packaging. I googled for a while and I can’t solve this puzzle. Please
help.


#2

Leo – wrote:

Hello!

I’m trying to add packaging to my rakefile. I copied the example code
from http://rake.rubyforge.org/classes/Rake/PackageTask.html, that’s it:

require ‘rake/packagetask’

Rake::PackageTask.new(“rake”, “1.2.3”) do |p|
p.need_tar = true
p.package_files.include(“lib/**/*.rb”)
end

but when I run rake --tasks, there are still no tasks related to
packaging. I googled for a while and I can’t solve this puzzle. Please
help.

The correct link is
http://rake.rubyforge.org/classes/Rake/PackageTask.html


#3

Leo – wrote:

Hello!

I’m trying to add packaging to my rakefile. I copied the example code
from http://rake.rubyforge.org/classes/Rake/PackageTask.html, that’s it:

require ‘rake/packagetask’

Rake::PackageTask.new(“rake”, “1.2.3”) do |p|
p.need_tar = true
p.package_files.include(“lib/**/*.rb”)
end

but when I run rake --tasks, there are still no tasks related to
packaging. I googled for a while and I can’t solve this puzzle. Please
help.

With your rake file, I get:

$ rake --tasks
(in C:/Documents and Settings/BA2828/My Documents/pgm/ruby/pkgtask)
rake clobber_package # Remove package products
rake package # Build all the packages
rake repackage # Force a rebuild of the package files


– Jim W.


#4

With your rake file, I get:

$ rake --tasks
(in C:/Documents and Settings/BA2828/My Documents/pgm/ruby/pkgtask)
rake clobber_package # Remove package products
rake package # Build all the packages
rake repackage # Force a rebuild of the package files


– Jim W.

Thanks for the inspiration! I double checked my code and found my silly
silly mistake. I put package tasks inside another (empty) task. Shame on
me!

desc ‘Build entire site’
task :build => [:copy_images, :copy_stylesheets, :generate_html ] do

Package tasks

Rake::PackageTask.new(“webdesign”, “0.1”) do |p|
p.need_zip = true
p.package_files.include(‘conf’)
end

end

Now I feel like many different kind of idiots :slight_smile:

Problem solved.

Leo