2009-06-16 14:13:45 +00:00
|
|
|
desc 'Builds lib/jasmine from source'
|
|
|
|
task :build do
|
2009-08-21 05:16:14 +00:00
|
|
|
require 'json'
|
2009-06-19 18:47:33 +00:00
|
|
|
|
2009-08-21 05:16:14 +00:00
|
|
|
version = JSON.parse(File.new("src/version.json").read);
|
|
|
|
sources = ["src/util.js", "src/Env.js", "src/Reporter.js", "src/Block.js"]
|
2009-06-19 18:47:33 +00:00
|
|
|
|
2009-08-21 05:16:14 +00:00
|
|
|
sources += Dir.glob('src/*.js').reject{|f| f == 'src/base.js' || sources.include?(f)}.sort
|
|
|
|
old_jasmine_files = Dir.glob('lib/jasmine*.js')
|
|
|
|
old_jasmine_files.each do |file|
|
|
|
|
File.delete(file)
|
|
|
|
end
|
|
|
|
jasmine = File.new("lib/jasmine-#{version['major']}.#{version['minor']}.#{version['build']}.js", 'w')
|
|
|
|
jasmine.puts(File.read('src/base.js'))
|
|
|
|
jasmine.puts %{
|
|
|
|
jasmine.version_= {
|
|
|
|
"major": #{version['major']},
|
|
|
|
"minor": #{version['minor']},
|
|
|
|
"build": #{version['build']},
|
|
|
|
"revision": #{version['revision']}
|
|
|
|
};
|
|
|
|
}
|
2009-06-16 14:13:45 +00:00
|
|
|
sources.each do |source_filename|
|
|
|
|
jasmine.puts(File.read(source_filename))
|
|
|
|
end
|
2009-08-01 17:43:03 +00:00
|
|
|
end
|