Skip to content
Newer
Older
100755 343 lines (297 sloc) 10.6 KB
bb4d189 @sstephenson prototype: Reorganize the source tree.
authored Jan 18, 2007
1 require 'rake'
2 require 'rake/packagetask'
0445d37 @savetheclocktower Update Rake "doc" task to integrate with Sprockets.
savetheclocktower authored Mar 6, 2009
3 require 'yaml'
4
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
5 module PrototypeHelper
6 ROOT_DIR = File.expand_path(File.dirname(__FILE__))
7 SRC_DIR = File.join(ROOT_DIR, 'src')
8 DIST_DIR = File.join(ROOT_DIR, 'dist')
9 DOC_DIR = File.join(ROOT_DIR, 'doc')
10 TEMPLATES_DIR = File.join(ROOT_DIR, 'templates')
11 PKG_DIR = File.join(ROOT_DIR, 'pkg')
12 TEST_DIR = File.join(ROOT_DIR, 'test')
13 TEST_UNIT_DIR = File.join(TEST_DIR, 'unit')
14 TMP_DIR = File.join(TEST_UNIT_DIR, 'tmp')
15 VERSION = YAML.load(IO.read(File.join(SRC_DIR, 'constants.yml')))['PROTOTYPE_VERSION']
732eb3d @savetheclocktower Change how PDoc is told which syntax highlighting engine to use. SYNT…
savetheclocktower authored Feb 20, 2010
16
a44a8db @tobie Avoid automatically fetching the vendor/sizzle git submodule.
tobie authored Dec 2, 2009
17 DEFAULT_SELECTOR_ENGINE = 'sizzle'
732eb3d @savetheclocktower Change how PDoc is told which syntax highlighting engine to use. SYNT…
savetheclocktower authored Feb 21, 2010
18
19 # Possible options for PDoc syntax highlighting, in order of preference.
20 SYNTAX_HIGHLIGHTERS = [:pygments, :coderay, :none]
107f812 @tobie Modify PrototypeHelper.sprocketize to take a hash of options rather t…
tobie authored Oct 24, 2009
21
75aab03 @tobie Repo and Rakefile refactoring.
tobie authored Oct 23, 2009
22 %w[sprockets pdoc unittest_js caja_builder].each do |name|
c5372d8 @savetheclocktower Detect if Sizzle hasn't been loaded via submodule.
savetheclocktower authored Oct 10, 2009
23 $:.unshift File.join(PrototypeHelper::ROOT_DIR, 'vendor', name, 'lib')
24 end
d3df9ba @savetheclocktower Automate installation of Git submodules.
savetheclocktower authored Oct 11, 2009
25
26 def self.has_git?
27 begin
28 `git --version`
29 return true
30 rescue Error => e
31 return false
32 end
33 end
34
35 def self.require_git
36 return if has_git?
37 puts "\nPrototype requires Git in order to load its dependencies."
38 puts "\nMake sure you've got Git installed and in your path."
39 puts "\nFor more information, visit:\n\n"
40 puts " http://book.git-scm.com/2_installing_git.html"
41 exit
42 end
732eb3d @savetheclocktower Change how PDoc is told which syntax highlighting engine to use. SYNT…
savetheclocktower authored Feb 21, 2010
43
107f812 @tobie Modify PrototypeHelper.sprocketize to take a hash of options rather t…
tobie authored Oct 24, 2009
44 def self.sprocketize(options = {})
45 options = {
46 :destination => File.join(DIST_DIR, options[:source]),
47 :strip_comments => true
48 }.merge(options)
49
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
50 require_sprockets
74c5d45 @samleb Fix custom selector engine load path resolution.
samleb authored Nov 30, 2009
51 load_path = [SRC_DIR]
107f812 @tobie Modify PrototypeHelper.sprocketize to take a hash of options rather t…
tobie authored Oct 24, 2009
52
a44a8db @tobie Avoid automatically fetching the vendor/sizzle git submodule.
tobie authored Dec 2, 2009
53 if selector_path = get_selector_engine(options[:selector_engine])
54 load_path << selector_path
107f812 @tobie Modify PrototypeHelper.sprocketize to take a hash of options rather t…
tobie authored Oct 24, 2009
55 end
56
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
57 secretary = Sprockets::Secretary.new(
107f812 @tobie Modify PrototypeHelper.sprocketize to take a hash of options rather t…
tobie authored Oct 24, 2009
58 :root => File.join(ROOT_DIR, options[:path]),
59 :load_path => load_path,
60 :source_files => [options[:source]],
61 :strip_comments => options[:strip_comments]
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
62 )
63
107f812 @tobie Modify PrototypeHelper.sprocketize to take a hash of options rather t…
tobie authored Oct 24, 2009
64 secretary.concatenation.save_to(options[:destination])
7762e00 @tobie Reorder repository to allow for custom selector engines to be include…
tobie authored Oct 23, 2009
65 end
66
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
67 def self.build_doc_for(file)
d11f317 @tobie Update PDoc.
tobie authored Apr 7, 2010
68 rm_rf(DOC_DIR)
69 mkdir_p(DOC_DIR)
0a0673a @savetheclocktower Update PDoc Rake task to include proper URLs for source code references.
savetheclocktower authored Nov 15, 2010
70 hash = current_head
6a584d2 @tobie Update pdoc.
tobie authored May 15, 2010
71 index_header = <<EOF
72 <h1 style="margin-top: 31px; height: 75px; padding: 1px 0; background: url(images/header-stripe-small.png) repeat-x;">
73 <a href="http://prototypejs.org" style="padding-left: 120px;">
74 <img src="images/header-logo-small.png" alt="Prototype JavaScript Framework API" />
75 </a>
76 </h1>
77 EOF
6839886 @tobie doc: Update PDoc. Default to BlueCloth Markdown parser to avoid Maruk…
tobie authored Dec 31, 2009
78 PDoc.run({
5e5cfff @josh Sprockets 2 compatibility
josh authored Dec 1, 2010
79 :source_files => Dir[File.join('src', 'prototype', '**', '*.js')],
0a0673a @savetheclocktower Update PDoc Rake task to include proper URLs for source code references.
savetheclocktower authored Nov 15, 2010
80 :destination => DOC_DIR,
81 :index_page => 'README.markdown',
d11f317 @tobie Update PDoc.
tobie authored Apr 7, 2010
82 :syntax_highlighter => syntax_highlighter,
0a0673a @savetheclocktower Update PDoc Rake task to include proper URLs for source code references.
savetheclocktower authored Nov 15, 2010
83 :markdown_parser => :bluecloth,
84 :src_code_text => "View source on GitHub &rarr;",
6a584d2 @tobie Update pdoc.
tobie authored May 15, 2010
85 :src_code_href => proc { |obj|
0a0673a @savetheclocktower Update PDoc Rake task to include proper URLs for source code references.
savetheclocktower authored Nov 15, 2010
86 "https://github.com/sstephenson/prototype/blob/#{hash}/#{obj.file}#L#{obj.line_number}"
694f36d @tobie Update to latest version of pdoc.
tobie authored May 7, 2010
87 },
5d454e4 @tobie Make documentation pretty urls option false. The Rake task is targete…
tobie authored May 7, 2010
88 :pretty_urls => false,
0a0673a @savetheclocktower Update PDoc Rake task to include proper URLs for source code references.
savetheclocktower authored Nov 15, 2010
89 :bust_cache => false,
748e73f @tobie Update PDoc yet again.
tobie authored Apr 7, 2010
90 :name => 'Prototype JavaScript Framework',
91 :short_name => 'Prototype',
92 :home_url => 'http://prototypejs.org',
93 :version => PrototypeHelper::VERSION,
6a584d2 @tobie Update pdoc.
tobie authored May 15, 2010
94 :index_header => index_header,
95 :footer => 'This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0 Unported License</a>.',
96 :assets => 'doc_assets'
6839886 @tobie doc: Update PDoc. Default to BlueCloth Markdown parser to avoid Maruk…
tobie authored Dec 31, 2009
97 })
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
98 end
99
732eb3d @savetheclocktower Change how PDoc is told which syntax highlighting engine to use. SYNT…
savetheclocktower authored Feb 21, 2010
100 def self.syntax_highlighter
101 if ENV['SYNTAX_HIGHLIGHTER']
102 highlighter = ENV['SYNTAX_HIGHLIGHTER'].to_sym
103 require_highlighter(highlighter, true)
104 return highlighter
105 end
106
107 SYNTAX_HIGHLIGHTERS.detect { |n| require_highlighter(n) }
108 end
109
110 def self.require_highlighter(name, verbose=false)
111 case name
112 when :pygments
d11f317 @tobie Update PDoc.
tobie authored Apr 7, 2010
113 success = system("pygmentize -V > /dev/null")
732eb3d @savetheclocktower Change how PDoc is told which syntax highlighting engine to use. SYNT…
savetheclocktower authored Feb 21, 2010
114 if !success && verbose
115 puts "\nYou asked to use Pygments, but I can't find the 'pygmentize' binary."
116 puts "To install, visit:\n"
117 puts " http://pygments.org/docs/installation/\n\n"
118 exit
119 end
120 return success # (we have pygments)
121 when :coderay
122 begin
123 require 'coderay'
124 rescue LoadError => e
125 if verbose
126 puts "\nYou asked to use CodeRay, but I can't find the 'coderay' gem. Just run:\n\n"
127 puts " $ gem install coderay"
128 puts "\nand you should be all set.\n\n"
129 exit
130 end
131 return false
132 end
133 return true # (we have CodeRay)
134 when :none
135 return true
136 else
137 puts "\nYou asked to use a syntax highlighter I don't recognize."
138 puts "Valid options: #{SYNTAX_HIGHLIGHTERS.join(', ')}\n\n"
139 exit
140 end
141 end
142
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
143 def self.require_sprockets
0a8cf9b @tobie Prevent Rakefile from mishandling missing gem errors.
tobie authored Sep 2, 2009
144 require_submodule('Sprockets', 'sprockets')
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
145 end
146
147 def self.require_pdoc
0a8cf9b @tobie Prevent Rakefile from mishandling missing gem errors.
tobie authored Sep 2, 2009
148 require_submodule('PDoc', 'pdoc')
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
149 end
150
151 def self.require_unittest_js
0a8cf9b @tobie Prevent Rakefile from mishandling missing gem errors.
tobie authored Sep 2, 2009
152 require_submodule('UnittestJS', 'unittest_js')
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
153 end
6d70608 @sstephenson Update to Sprockets 0.9.0
authored Feb 10, 2009
154
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
155 def self.require_caja_builder
0a8cf9b @tobie Prevent Rakefile from mishandling missing gem errors.
tobie authored Sep 2, 2009
156 require_submodule('CajaBuilder', 'caja_builder')
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
157 end
158
75aab03 @tobie Repo and Rakefile refactoring.
tobie authored Oct 23, 2009
159 def self.get_selector_engine(name)
c312cbc @savetheclocktower Build with the submodule version Sizzle if it exists; otherwise build…
savetheclocktower authored Feb 17, 2012
160 return if !name
161 # If the submodule exists, we should use it, even if we're using the
162 # default engine; the user might have fetched it manually, and thus would
163 # want to build a distributable with the most recent version of that
164 # engine.
74c5d45 @samleb Fix custom selector engine load path resolution.
samleb authored Nov 30, 2009
165 submodule_path = File.join(ROOT_DIR, "vendor", name)
166 return submodule_path if File.exist?(File.join(submodule_path, "repository", ".git"))
d9aee20 @tobie Refactor selector engine wrapper and add convenience helper methods t…
tobie authored May 11, 2010
167 return submodule_path if name === "legacy_selector"
c312cbc @savetheclocktower Build with the submodule version Sizzle if it exists; otherwise build…
savetheclocktower authored Feb 18, 2012
168
169 # If it doesn't exist, we should fetch it, _unless_ it's the default
170 # engine. We've already got a known version of the default engine in our
171 # load path.
172 return if name == DEFAULT_SELECTOR_ENGINE
74c5d45 @samleb Fix custom selector engine load path resolution.
samleb authored Nov 30, 2009
173 get_submodule('the required selector engine', "#{name}/repository")
9d47112 @tobie Fix typo in Rakefile.
tobie authored Dec 2, 2009
174 unless File.exist?(submodule_path)
74c5d45 @samleb Fix custom selector engine load path resolution.
samleb authored Nov 30, 2009
175 puts "The selector engine you required isn't available at vendor/#{name}.\n\n"
176 exit
15c323b @tobie Include NWMatcher as a submodule.
tobie authored Oct 23, 2009
177 end
178 end
179
d3df9ba @savetheclocktower Automate installation of Git submodules.
savetheclocktower authored Oct 11, 2009
180 def self.get_submodule(name, path)
181 require_git
182 puts "\nYou seem to be missing #{name}. Obtaining it via git...\n\n"
183
184 Kernel.system("git submodule init")
185 return true if Kernel.system("git submodule update vendor/#{path}")
186 # If we got this far, something went wrong.
187 puts "\nLooks like it didn't work. Try it manually:\n\n"
188 puts " $ git submodule init"
189 puts " $ git submodule update vendor/#{path}"
190 false
191 end
192
0a8cf9b @tobie Prevent Rakefile from mishandling missing gem errors.
tobie authored Sep 2, 2009
193 def self.require_submodule(name, path)
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
194 begin
0a8cf9b @tobie Prevent Rakefile from mishandling missing gem errors.
tobie authored Sep 2, 2009
195 require path
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
196 rescue LoadError => e
d3df9ba @savetheclocktower Automate installation of Git submodules.
savetheclocktower authored Oct 11, 2009
197 # Wait until we notice that a submodule is missing before we bother the
198 # user about installing git. (Maybe they brought all the files over
199 # from a different machine.)
0a8cf9b @tobie Prevent Rakefile from mishandling missing gem errors.
tobie authored Sep 2, 2009
200 missing_file = e.message.sub('no such file to load -- ', '')
201 if missing_file == path
d3df9ba @savetheclocktower Automate installation of Git submodules.
savetheclocktower authored Oct 11, 2009
202 # Missing a git submodule.
203 retry if get_submodule(name, path)
0a8cf9b @tobie Prevent Rakefile from mishandling missing gem errors.
tobie authored Sep 2, 2009
204 else
d3df9ba @savetheclocktower Automate installation of Git submodules.
savetheclocktower authored Oct 11, 2009
205 # Missing a gem.
0a8cf9b @tobie Prevent Rakefile from mishandling missing gem errors.
tobie authored Sep 2, 2009
206 puts "\nIt looks like #{name} is missing the '#{missing_file}' gem. Just run:\n\n"
207 puts " $ gem install #{missing_file}"
208 puts "\nand you should be all set.\n\n"
209 end
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
210 exit
211 end
212 end
d11f317 @tobie Update PDoc.
tobie authored Apr 7, 2010
213
214 def self.current_head
f890b3d @tobie Update PDoc some more.
tobie authored Apr 7, 2010
215 `git show-ref --hash HEAD`.chomp[0..6]
d11f317 @tobie Update PDoc.
tobie authored Apr 7, 2010
216 end
b2597ec @samleb Start PDoc integration.
samleb authored Dec 14, 2008
217 end
218
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
219 task :default => [:dist, :dist_helper, :package, :clean_package_source]
220
a519c02 @sstephenson Sprocketize Prototype
authored Jan 27, 2009
221 desc "Builds the distribution."
222 task :dist do
107f812 @tobie Modify PrototypeHelper.sprocketize to take a hash of options rather t…
tobie authored Oct 24, 2009
223 PrototypeHelper.sprocketize(
224 :path => 'src',
225 :source => 'prototype.js',
a44a8db @tobie Avoid automatically fetching the vendor/sizzle git submodule.
tobie authored Dec 2, 2009
226 :selector_engine => ENV['SELECTOR_ENGINE'] || PrototypeHelper::DEFAULT_SELECTOR_ENGINE
107f812 @tobie Modify PrototypeHelper.sprocketize to take a hash of options rather t…
tobie authored Oct 24, 2009
227 )
a519c02 @sstephenson Sprocketize Prototype
authored Jan 27, 2009
228 end
229
4428747 @savetheclocktower Updated Rakefile to check for presence of PDoc before running 'doc' t…
savetheclocktower authored Jan 12, 2009
230 namespace :doc do
231 desc "Builds the documentation."
232 task :build => [:require] do
63f96ea @tobie Fixed doc template to allow separate building of the documentation of…
tobie authored Aug 22, 2009
233 PrototypeHelper.build_doc_for(ENV['SECTION'] ? "#{ENV['SECTION']}.js" : 'prototype.js')
732eb3d @savetheclocktower Change how PDoc is told which syntax highlighting engine to use. SYNT…
savetheclocktower authored Feb 21, 2010
234 end
4428747 @savetheclocktower Updated Rakefile to check for presence of PDoc before running 'doc' t…
savetheclocktower authored Jan 12, 2009
235
236 task :require do
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
237 PrototypeHelper.require_pdoc
bb4d189 @sstephenson prototype: Reorganize the source tree.
authored Jan 18, 2007
238 end
239 end
240
4428747 @savetheclocktower Updated Rakefile to check for presence of PDoc before running 'doc' t…
savetheclocktower authored Jan 12, 2009
241 task :doc => ['doc:build']
242
cf5d180 @tobie refactored unit tests quite a bit. Added JS and CSS fixtures.
tobie authored Apr 23, 2008
243 desc "Builds the updating helper."
87ce153 @tobie prototype: Complete rewrite of the deprecation helper.
tobie authored Mar 15, 2008
244 task :dist_helper do
107f812 @tobie Modify PrototypeHelper.sprocketize to take a hash of options rather t…
tobie authored Oct 24, 2009
245 PrototypeHelper.sprocketize(:path => 'ext/update_helper', :source => 'prototype_update_helper.js')
87ce153 @tobie prototype: Complete rewrite of the deprecation helper.
tobie authored Mar 15, 2008
246 end
247
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
248 Rake::PackageTask.new('prototype', PrototypeHelper::VERSION) do |package|
bb4d189 @sstephenson prototype: Reorganize the source tree.
authored Jan 18, 2007
249 package.need_tar_gz = true
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
250 package.package_dir = PrototypeHelper::PKG_DIR
bb4d189 @sstephenson prototype: Reorganize the source tree.
authored Jan 18, 2007
251 package.package_files.include(
252 '[A-Z]*',
253 'dist/prototype.js',
254 'lib/**',
255 'src/**',
256 'test/**'
257 )
258 end
259
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
260 task :clean_package_source do
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
261 rm_rf File.join(PrototypeHelper::PKG_DIR, "prototype-#{PrototypeHelper::VERSION}")
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
262 end
bb4d189 @sstephenson prototype: Reorganize the source tree.
authored Jan 18, 2007
263
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
264 task :test => ['test:build', 'test:run']
265 namespace :test do
266 desc 'Runs all the JavaScript unit tests and collects the results'
267 task :run => [:require] do
268 testcases = ENV['TESTCASES']
269 browsers_to_test = ENV['BROWSERS'] && ENV['BROWSERS'].split(',')
270 tests_to_run = ENV['TESTS'] && ENV['TESTS'].split(',')
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
271 runner = UnittestJS::WEBrickRunner::Runner.new(:test_dir => PrototypeHelper::TMP_DIR)
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
272
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
273 Dir[File.join(PrototypeHelper::TMP_DIR, '*_test.html')].each do |file|
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
274 file = File.basename(file)
275 test = file.sub('_test.html', '')
276 unless tests_to_run && !tests_to_run.include?(test)
277 runner.add_test(file, testcases)
278 end
279 end
280
281 UnittestJS::Browser::SUPPORTED.each do |browser|
282 unless browsers_to_test && !browsers_to_test.include?(browser)
283 runner.add_browser(browser.to_sym)
284 end
285 end
286
287 trap('INT') { runner.teardown; exit }
288 runner.run
289 end
bb4d189 @sstephenson prototype: Reorganize the source tree.
authored Jan 18, 2007
290
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
291 task :build => [:clean, :dist] do
292 builder = UnittestJS::Builder::SuiteBuilder.new({
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
293 :input_dir => PrototypeHelper::TEST_UNIT_DIR,
294 :assets_dir => PrototypeHelper::DIST_DIR
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
295 })
296 selected_tests = (ENV['TESTS'] || '').split(',')
297 builder.collect(*selected_tests)
298 builder.render
299 end
ba6934e @tobie Make Rake auto-generate test/unit/temp directory if it is missing.
tobie authored Apr 23, 2008
300
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
301 task :clean => [:require] do
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
302 UnittestJS::Builder.empty_dir!(PrototypeHelper::TMP_DIR)
bb4d189 @sstephenson prototype: Reorganize the source tree.
authored Jan 18, 2007
303 end
304
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
305 task :require do
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
306 PrototypeHelper.require_unittest_js
bb4d189 @sstephenson prototype: Reorganize the source tree.
authored Jan 18, 2007
307 end
308 end
41ef42e @tobie Unit test lib reorganizing.
tobie authored Sep 8, 2008
309
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
310 task :test_units do
311 puts '"rake test_units" is deprecated. Please use "rake test" instead.'
41ef42e @tobie Unit test lib reorganizing.
tobie authored Sep 8, 2008
312 end
313
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
314 task :build_unit_tests do
315 puts '"rake test_units" is deprecated. Please use "rake test:build" instead.'
41ef42e @tobie Unit test lib reorganizing.
tobie authored Sep 8, 2008
316 end
317
318 task :clean_tmp do
52a781a @tobie Switch to UnittestJS.
tobie authored Dec 11, 2008
319 puts '"rake clean_tmp" is deprecated. Please use "rake test:clean" instead.'
41ef42e @tobie Unit test lib reorganizing.
tobie authored Sep 8, 2008
320 end
99f74b5 @tobie Add caja_builder for optional cajoled tests.
tobie authored Dec 12, 2008
321
322 namespace :caja do
323 task :test => ['test:build', 'test:run']
324
325 namespace :test do
326 task :run => ['rake:test:run']
327
328 task :build => [:require, 'rake:test:clean', :dist] do
329 builder = UnittestJS::CajaBuilder::SuiteBuilder.new({
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
330 :input_dir => PrototypeHelper::TEST_UNIT_DIR,
331 :assets_dir => PrototypeHelper::DIST_DIR,
332 :whitelist_dir => File.join(PrototypeHelper::TEST_DIR, 'unit', 'caja_whitelists'),
99f74b5 @tobie Add caja_builder for optional cajoled tests.
tobie authored Dec 12, 2008
333 :html_attrib_schema => 'html_attrib.json'
334 })
335 selected_tests = (ENV['TESTS'] || '').split(',')
336 builder.collect(*selected_tests)
337 builder.render
338 end
339 end
340 task :require => ['rake:test:require'] do
ea9f797 @tobie Refactor Rakefile.
tobie authored Aug 22, 2009
341 PrototypeHelper.require_caja_builder
99f74b5 @tobie Add caja_builder for optional cajoled tests.
tobie authored Dec 12, 2008
342 end
343 end
Something went wrong with that request. Please try again.