Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions gems/kettle-jem/lib/kettle/jem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ class Error < StandardError; end
MONOREPO_SUBGEM_TEMPLATE_ENTRIES + [
"Gemfile",
"Rakefile",
".gitignore",
".rspec",
".simplecov",
".yard-lint.yml",
Expand Down Expand Up @@ -13838,6 +13839,14 @@ def add_monorepo_subgem_file_overrides(content, gemspec_path, profile = MONOREPO
" Rakefile:",
" strategy: accept_template"
]
if normalize_template_profile(profile) == MONOREPO_SUBGEM_RELEASE_TEMPLATE_PROFILE
override_lines.concat([
" .gitignore:",
" strategy: merge",
" preference: destination",
" add_template_only_nodes: true"
])
end
gemspec = gemspec_path.to_s.strip
unless gemspec.empty?
override_lines.concat([
Expand Down
10 changes: 9 additions & 1 deletion gems/kettle-jem/spec/integration/template_bootstrap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@
expect(config_yaml.dig("templates", "entries")).to include(
"Gemfile",
"Rakefile",
".gitignore",
".rspec",
".simplecov",
".yard-lint.yml",
Expand All @@ -1133,8 +1134,13 @@
"spec/spec_helper.rb",
"gemfiles/modular/documentation.gemfile"
)
expect(config_yaml.dig("files", ".gitignore")).to include(
"strategy" => "merge", "preference" => "destination", "add_template_only_nodes" => true
)
expect(config_yaml.dig("files", "tree_haver.gemspec", "strategy")).to eq("merge")

File.write(File.join(root, ".gitignore"), "/custom-artifact/\n")

configure_dependency_conflicts(root, [
{"gem" => "version_gem", "direct" => "tree_haver.gemspec", "modular" => "gemfiles/modular/runtime_heads.gemfile", "action" => "keep_both", "reason" => "The runtime gemspec and HEAD appraisal intentionally share this dependency."}
])
Expand All @@ -1143,6 +1149,7 @@
expect(apply.fetch(:changed_files)).to include("Gemfile", ".yard-lint.yml", ".yardopts", ".yardignore", "bin/setup", "spec/README.md")
expect(File).to exist(File.join(root, "Rakefile"))
expect(File).to exist(File.join(root, "Gemfile"))
expect(File.read(File.join(root, ".gitignore"))).to include("/custom-artifact/", "/coverage/")
expect(File.read(File.join(root, ".rspec"))).to include("--exclude-pattern spec/tmp/**/*_spec.rb")
expect(File.read(File.join(root, "spec", "README.md"))).to include("stub_env")
expect(File.read(File.join(root, "spec", "README.md"))).to include("include_context \"with rake\"")
Expand All @@ -1156,7 +1163,8 @@
expect(File.read(File.join(root, "gemfiles", "modular", "documentation.gemfile"))).to include('gem "yard-lint"')
updated_config = YAML.safe_load_file(File.join(root, ".structuredmerge", "kettle-jem.yml"))
expect(updated_config.dig("templates", "profile")).to eq("monorepo-subgem-release")
expect(updated_config.dig("templates", "entries")).to include("Rakefile", ".yard-lint.yml", ".yardopts")
expect(updated_config.dig("templates", "entries")).to include("Rakefile", ".gitignore", ".yard-lint.yml", ".yardopts")
expect(updated_config.dig("files", ".gitignore")).to include("strategy" => "merge", "preference" => "destination")
end
end

Expand Down
Loading