Skip to content

Commit

Permalink
Fix the build process for core/non-core gems
Browse files Browse the repository at this point in the history
  • Loading branch information
damianlegawiec committed Jul 14, 2021
1 parent a135a98 commit 7479399
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
eval_gemfile('common_spree_dependencies.rb')

gem 'spree_frontend', path: 'frontend'
gem 'spree_backend', path: 'backend'
gem 'spree_emails', path: 'emails'

gemspec
2 changes: 1 addition & 1 deletion backend/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ task default: :spec
desc "Generates a dummy app for testing"
task :test_app do
ENV['LIB_NAME'] = 'spree/backend'
Rake::Task['common:test_app'].execute( { install_admin: true } )
Rake::Task['common:test_app'].execute( { install_admin: true, install_storefront: false } )
end
9 changes: 8 additions & 1 deletion bin/build-ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def initialize(name)
end

ALL = %w[api backend core frontend emails sample].map(&method(:new)).freeze
CORE_GEMS = %w[api core sample].freeze

# Install subproject
#
Expand Down Expand Up @@ -91,7 +92,13 @@ def bundle_install
#
# @return [undefined]
def setup_test_app
system("bundle exec --gemfile=#{ROOT_GEMFILE} rake test_app") || raise('Failed to setup the test app')
gemfile_path = if CORE_GEMS.include?(self.name)
ROOT_GEMFILE
else
'./Gemfile'
end

system("bundle exec --gemfile=#{gemfile_path} rake test_app ") || raise('Failed to setup the test app')
end

# Run tests for subproject
Expand Down
2 changes: 1 addition & 1 deletion core/lib/generators/spree/dummy/dummy_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def remove_directory_if_exists(path)
end

def gemfile_path
core_gems = ['spree/core', 'spree/api', 'spree/backend', 'spree/frontend', 'spree/sample']
core_gems = ['spree/core', 'spree/api', 'spree/sample']

if core_gems.include?(lib_name)
'../../../../../Gemfile'
Expand Down
2 changes: 1 addition & 1 deletion core/lib/spree/testing_support/common_rake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
desc 'Generates a dummy app for testing'
namespace :common do
task :test_app, :user_class do |_t, args|
args.with_defaults(user_class: 'Spree::LegacyUser', install_storefront: 'false')
args.with_defaults(user_class: 'Spree::LegacyUser', install_storefront: 'false', install_admin: 'false')
require ENV['LIB_NAME'].to_s

ENV['RAILS_ENV'] = 'test'
Expand Down
2 changes: 1 addition & 1 deletion frontend/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ task default: :spec
desc "Generates a dummy app for testing"
task :test_app do
ENV['LIB_NAME'] = 'spree/frontend'
Rake::Task['common:test_app'].execute( { install_storefront: true } )
Rake::Task['common:test_app'].execute( { install_storefront: true, install_admin: false } )
end

0 comments on commit 7479399

Please sign in to comment.