Skip to content

Commit

Permalink
Only rebuild the spec/internal app if the generated app might change
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Feb 23, 2015
1 parent 0fdd53c commit c9e36d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ Bundler::GemHelper.install_tasks

load "tasks/blacklight.rake"

task :default => [:ci]
task :clean => ['blacklight:clean']
task :default => [:ci]
2 changes: 1 addition & 1 deletion blacklight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "rspec-collection_matchers", ">= 1.0"
s.add_development_dependency "capybara"
s.add_development_dependency "poltergeist"
s.add_development_dependency 'engine_cart', ">= 0.1.0"
s.add_development_dependency 'engine_cart', ">= 0.5.0"
s.add_development_dependency "equivalent-xml"
end
11 changes: 8 additions & 3 deletions tasks/blacklight.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = 'spec/**/*_spec.rb'
end

EngineCart.fingerprint_proc = lambda do
BLACKLIGHT_ROOT = File.expand_path("..", File.dirname(__FILE__))
(Dir.glob("#{BLACKLIGHT_ROOT}/*.gemspec") + Dir.glob("#{BLACKLIGHT_ROOT}/Gemfile") + Dir.glob("#{BLACKLIGHT_ROOT}/db/migrate/*") + Dir.glob("#{BLACKLIGHT_ROOT}/lib/generators/**/**") + Dir.glob("#{BLACKLIGHT_ROOT}/spec/test_app_templates/**/**")).map {|f| File.mtime(f) }.max.to_s
end

desc "Run test suite"
task :ci => 'blacklight:clean' do
task :ci => ['blacklight:generate', 'blacklight:clean'] do
jetty_params = Jettywrapper.load_config('test')
error = Jettywrapper.wrap(jetty_params) do
Rake::Task["blacklight:fixtures"].invoke
Expand All @@ -33,8 +38,8 @@ namespace :blacklight do
Rake::Task["spec"].invoke
end

desc "Clean out the test rails app"
task :clean => ['engine_cart:clean', 'jetty:clean'] do
desc "Clean out the test jetty"
task :clean => ['jetty:clean'] do
end

desc "Create the test rails app"
Expand Down

0 comments on commit c9e36d5

Please sign in to comment.