Refactor how the distribution is built
This commit is contained in:
@@ -2467,5 +2467,5 @@ jasmine.version_= {
|
||||
"major": 1,
|
||||
"minor": 1,
|
||||
"build": 0,
|
||||
"revision": 1307836216
|
||||
"revision": 1307978448
|
||||
}
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
desc "Build core jasmine.js"
|
||||
task :build_jasmine_js => :lint do
|
||||
puts 'Building Jasmine from source'
|
||||
task :build_dist => :lint do
|
||||
puts 'Building Jasmine distribution from source'
|
||||
|
||||
File.open("lib/jasmine.js", 'w') do |jasmine_js|
|
||||
core_sources.each do |source_filename|
|
||||
file = File.read(source_filename)
|
||||
# file += "\n" unless file.match(/\n$/)
|
||||
file.chomp
|
||||
jasmine_js << file
|
||||
concat_into('lib/jasmine.js') { [core_sources, version_source] }
|
||||
concat_into('lib/jasmine-html.js') { html_sources }
|
||||
|
||||
FileUtils.cp('src/html/jasmine.css', 'lib/jasmine.css')
|
||||
end
|
||||
|
||||
def concat_into(output_file, &block)
|
||||
files, extra = yield
|
||||
File.open(output_file, 'w') do |out|
|
||||
files.each do |f|
|
||||
out << File.read(f)
|
||||
end
|
||||
|
||||
jasmine_js << version_source
|
||||
out << extra if extra
|
||||
end
|
||||
|
||||
File.open("lib/jasmine-html.js", 'w') do |jasmine_html|
|
||||
html_sources.each do |source_filename|
|
||||
jasmine_html.puts(File.read(source_filename))
|
||||
end
|
||||
end
|
||||
|
||||
FileUtils.cp("src/html/jasmine.css", "lib/jasmine.css")
|
||||
end
|
||||
|
||||
desc 'Check jasmine sources for coding problems'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
desc "Run spec suite: Browser, Node, JSHint"
|
||||
task :spec => ["build_jasmine_js", "count_specs", "spec:node", "spec:browser"]
|
||||
task :spec => ["build_dist", "count_specs", "spec:node", "spec:browser"]
|
||||
|
||||
desc 'Run specs in Node.js'
|
||||
task "spec:node" => [:count_specs, :require_node] do
|
||||
|
||||
Reference in New Issue
Block a user