Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix the build process for core/non-core gems

Damian Legawiec7479399b13a3
diff --git a/Gemfile b/Gemfile
index 7b6ed31d1a..33371e00f3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -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
diff --git a/backend/Rakefile b/backend/Rakefile
index 05d6175e11..d236bf438f 100644
--- a/backend/Rakefile
+++ b/backend/Rakefile
@@ -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
diff --git a/bin/build-ci.rb b/bin/build-ci.rb
index 59f48f60fe..70a9b883ba 100755
--- a/bin/build-ci.rb
+++ b/bin/build-ci.rb
@@ -22,6 +22,7 @@ class Project
end
ALL = %w[api backend core frontend emails sample].map(&method(:new)).freeze
+ CORE_GEMS = %w[api core sample].freeze
# Install subproject
#
@@ -91,7 +92,13 @@ class Project
#
# @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
diff --git a/core/lib/generators/spree/dummy/dummy_generator.rb b/core/lib/generators/spree/dummy/dummy_generator.rb
index ca50bebe1e..39170b90e8 100644
--- a/core/lib/generators/spree/dummy/dummy_generator.rb
+++ b/core/lib/generators/spree/dummy/dummy_generator.rb
@@ -137,7 +137,7 @@ end
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'
diff --git a/core/lib/spree/testing_support/common_rake.rb b/core/lib/spree/testing_support/common_rake.rb
index c7a2c95083..f2cd41acef 100644
--- a/core/lib/spree/testing_support/common_rake.rb
+++ b/core/lib/spree/testing_support/common_rake.rb
@@ -8,7 +8,7 @@ require 'generators/spree/dummy_model/dummy_model_generator'
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'
diff --git a/frontend/Rakefile b/frontend/Rakefile
index e7349090e1..df8c993303 100644
--- a/frontend/Rakefile
+++ b/frontend/Rakefile
@@ -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