canvas-lms/Gemfile.d/plugins.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1.1 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
#
# Copyright (C) 2014 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
inline_plugins = %w[
keep lockfiles in sync as part of `bundle` commands closes AE-283 this eliminates script/sync_lockfiles.rb and integrates its functionality directly into `bundle install`, `bundle check`, etc. it also generalizes a few pieces so that the same approach is used for all use cases: * syncing versions between the main Gemfile and gems in gems/ * maintaining separate lockfiles for no plugins/including private plugins * maintaining separate lockfiles for multiple Rails versions (crossed with the previous bullet) The differences between them are just small variations on how strict versions must match between lockfiles, and requiring pinning of versions not in the default lockfile. For full details, checks the docs on BundlerLockfileExtensions This does change the strategy for filtering private plugin dependencies out of the committed lockfile(s) - instead of filtering based on hash of source, simply don't even include private plugin gems in the gemfile when building the filtered lockfile (i.e. dynamic Gemfile, rather than monkeypatching bundler to filter out -- semi-succesfully -- private plugins from the Definition). It also changes the "default" lockfile for Canvas that gets checked in to be Gemfile.lock, so that other tools that are not multi-lockfile aware can find it (such as rubocop, dependabot, and others). This will be the lockfile corresponding to the current default rails version for Canvas, and without private plugins. Change-Id: I7ba398381974acbc4445f34fa3b788e8a07c5ce6 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317888 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Jacob Burroughs <jburroughs@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com> Build-Review: Cody Cutrer <cody@instructure.com>
2023-05-11 02:12:39 +08:00
academic_benchmark
account_reports
moodle_importer
qti_exporter
respondus_soap_endpoint
simply_versioned
].freeze
gemfile_root.glob("../gems/plugins/*") do |plugin_dir|
next unless File.directory?(plugin_dir)
keep lockfiles in sync as part of `bundle` commands closes AE-283 this eliminates script/sync_lockfiles.rb and integrates its functionality directly into `bundle install`, `bundle check`, etc. it also generalizes a few pieces so that the same approach is used for all use cases: * syncing versions between the main Gemfile and gems in gems/ * maintaining separate lockfiles for no plugins/including private plugins * maintaining separate lockfiles for multiple Rails versions (crossed with the previous bullet) The differences between them are just small variations on how strict versions must match between lockfiles, and requiring pinning of versions not in the default lockfile. For full details, checks the docs on BundlerLockfileExtensions This does change the strategy for filtering private plugin dependencies out of the committed lockfile(s) - instead of filtering based on hash of source, simply don't even include private plugin gems in the gemfile when building the filtered lockfile (i.e. dynamic Gemfile, rather than monkeypatching bundler to filter out -- semi-succesfully -- private plugins from the Definition). It also changes the "default" lockfile for Canvas that gets checked in to be Gemfile.lock, so that other tools that are not multi-lockfile aware can find it (such as rubocop, dependabot, and others). This will be the lockfile corresponding to the current default rails version for Canvas, and without private plugins. Change-Id: I7ba398381974acbc4445f34fa3b788e8a07c5ce6 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317888 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Jacob Burroughs <jburroughs@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com> Build-Review: Cody Cutrer <cody@instructure.com>
2023-05-11 02:12:39 +08:00
gem_name = File.basename(plugin_dir)
next unless @include_plugins || inline_plugins.include?(gem_name)
gem(gem_name, path: plugin_dir.relative_path_from(gemfile_root))
end