-
-
Notifications
You must be signed in to change notification settings - Fork 635
Expand file tree
/
Copy pathRakefile
More file actions
31 lines (26 loc) · 1.2 KB
/
Rakefile
File metadata and controls
31 lines (26 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true
# Root Rakefile for monorepo development
#
# This file enables running rake tasks from the monorepo root directory.
# It loads:
# 1. Monorepo-level tasks from ./rakelib/ (e.g., release task for both gems)
# 2. The react_on_rails gem's Rakefile
# 3. The react_on_rails gem's rakelib tasks
#
# Usage: bundle exec rake -T (from monorepo root)
#
# Note: This is for development only. When the gem is installed in a Rails app,
# Rails::Engine handles rake task loading automatically from lib/tasks/.
# Define gem_root helper for use by rake tasks
def gem_root
File.expand_path("react_on_rails", __dir__)
end
# Load the open-source gem's Rakefile
load File.expand_path("Rakefile", gem_root)
# Load all rake tasks from the gem's rakelib directory
# Rake only auto-loads from ./rakelib in the current working directory,
# so we must explicitly load from the subdirectory.
Dir[File.join(gem_root, "rakelib", "*.rake")].each { |rake_file| load rake_file }
# NOTE: Monorepo-level rake tasks from ./rakelib/ are auto-loaded by Rake.
# Do NOT explicitly load them here, as that would cause tasks to be defined twice
# and their bodies would run twice (Rake appends duplicate task definitions).