Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor gemspecs to no longer use gemspec_helper.rb. #78

Merged
merged 1 commit into from
Dec 30, 2024
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
48 changes: 39 additions & 9 deletions elasticgraph-admin/elasticgraph-admin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,48 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :core) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-admin"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "ElasticGraph gem that provides datastore administrative tasks, to keep a datastore up-to-date with an ElasticGraph schema."

spec.add_dependency "elasticgraph-datastore_core", eg_version
spec.add_dependency "elasticgraph-indexer", eg_version
spec.add_dependency "elasticgraph-schema_artifacts", eg_version
spec.add_dependency "elasticgraph-support", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "core" # used by script/update_codebase_overview
}

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-datastore_core", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-indexer", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
spec.add_dependency "rake", "~> 13.2"

spec.add_development_dependency "elasticgraph-elasticsearch", eg_version
spec.add_development_dependency "elasticgraph-opensearch", eg_version
spec.add_development_dependency "elasticgraph-schema_definition", eg_version
spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION
end
39 changes: 34 additions & 5 deletions elasticgraph-admin_lambda/elasticgraph-admin_lambda.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,42 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :lambda) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-admin_lambda"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "ElasticGraph gem that wraps elasticgraph-admin in an AWS Lambda."

spec.add_dependency "rake", "~> 13.2"
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "lambda" # used by script/update_codebase_overview
}

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.add_dependency "elasticgraph-admin", eg_version
spec.add_dependency "elasticgraph-lambda_support", eg_version
spec.required_ruby_version = "~> 3.2"

spec.add_dependency "rake", "~> 13.2"
spec.add_dependency "elasticgraph-admin", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-lambda_support", ElasticGraph::VERSION
end
36 changes: 0 additions & 36 deletions elasticgraph-apollo/apollo_tests_implementation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,21 @@ WORKDIR /web

# Each of the elasticgraph gems this implementation depends on must be
# copied into the container so it's available for inclusion in the bundle.
# Note: we've observed that hidden files (like .rspec) are not copied by COPY.
# gemspec_helper enforces the presence of `.rspec`/`.yardopts`, so we have to copy them.
COPY elasticgraph-admin /web/elasticgraph-admin
COPY elasticgraph-admin/.rspec /web/elasticgraph-admin/.rspec
COPY elasticgraph-admin/.yardopts /web/elasticgraph-admin/.yardopts

COPY elasticgraph-apollo /web/elasticgraph-apollo
COPY elasticgraph-apollo/.rspec /web/elasticgraph-apollo/.rspec
COPY elasticgraph-apollo/.yardopts /web/elasticgraph-apollo/.yardopts

COPY elasticgraph-datastore_core /web/elasticgraph-datastore_core
COPY elasticgraph-datastore_core/.rspec /web/elasticgraph-datastore_core/.rspec
COPY elasticgraph-datastore_core/.yardopts /web/elasticgraph-datastore_core/.yardopts

COPY elasticgraph-elasticsearch /web/elasticgraph-elasticsearch
COPY elasticgraph-elasticsearch/.rspec /web/elasticgraph-elasticsearch/.rspec
COPY elasticgraph-elasticsearch/.yardopts /web/elasticgraph-elasticsearch/.yardopts

COPY elasticgraph-graphql /web/elasticgraph-graphql
COPY elasticgraph-graphql/.rspec /web/elasticgraph-graphql/.rspec
COPY elasticgraph-graphql/.yardopts /web/elasticgraph-graphql/.yardopts

COPY elasticgraph-indexer /web/elasticgraph-indexer
COPY elasticgraph-indexer/.rspec /web/elasticgraph-indexer/.rspec
COPY elasticgraph-indexer/.yardopts /web/elasticgraph-indexer/.yardopts

COPY elasticgraph-json_schema /web/elasticgraph-json_schema
COPY elasticgraph-json_schema/.rspec /web/elasticgraph-json_schema/.rspec
COPY elasticgraph-json_schema/.yardopts /web/elasticgraph-json_schema/.yardopts

COPY elasticgraph-rack /web/elasticgraph-rack
COPY elasticgraph-rack/.rspec /web/elasticgraph-rack/.rspec
COPY elasticgraph-rack/.yardopts /web/elasticgraph-rack/.yardopts

COPY elasticgraph-schema_artifacts /web/elasticgraph-schema_artifacts
COPY elasticgraph-schema_artifacts/.rspec /web/elasticgraph-schema_artifacts/.rspec
COPY elasticgraph-schema_artifacts/.yardopts /web/elasticgraph-schema_artifacts/.yardopts

COPY elasticgraph-schema_definition /web/elasticgraph-schema_definition
COPY elasticgraph-schema_definition/.rspec /web/elasticgraph-schema_definition/.rspec
COPY elasticgraph-schema_definition/.yardopts /web/elasticgraph-schema_definition/.yardopts

COPY elasticgraph-support /web/elasticgraph-support
COPY elasticgraph-support/.rspec /web/elasticgraph-support/.rspec
COPY elasticgraph-support/.yardopts /web/elasticgraph-support/.yardopts

# We also have to copy the implementation files (config, schema, etc) as well.
COPY elasticgraph-apollo/apollo_tests_implementation /web/

COPY gemspec_helper.rb /web/gemspec_helper.rb

# We need to install the bundle and generate our schema artifacts.
RUN bundle install
RUN bundle exec rake schema_artifacts:dump TARGET_APOLLO_FEDERATION_VERSION=${TARGET_APOLLO_FEDERATION_VERSION}
Expand Down
48 changes: 39 additions & 9 deletions elasticgraph-apollo/elasticgraph-apollo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,52 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :extension) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-apollo"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "An ElasticGraph extension that implements the Apollo federation spec."

spec.add_dependency "elasticgraph-graphql", eg_version
spec.add_dependency "elasticgraph-support", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "extension" # used by script/update_codebase_overview
}

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
spec.add_dependency "graphql", "~> 2.4.8"
spec.add_dependency "apollo-federation", "~> 3.8"

# Note: technically, this is not purely a development dependency, but since `eg-schema_def`
# isn't intended to be used in production (or even included in a deployed bundle) we don't
# want to declare it as normal dependency here.
spec.add_development_dependency "elasticgraph-schema_definition", eg_version
spec.add_development_dependency "elasticgraph-admin", eg_version
spec.add_development_dependency "elasticgraph-elasticsearch", eg_version
spec.add_development_dependency "elasticgraph-opensearch", eg_version
spec.add_development_dependency "elasticgraph-indexer", eg_version
spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-admin", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-indexer", ElasticGraph::VERSION
end
46 changes: 38 additions & 8 deletions elasticgraph-datastore_core/elasticgraph-datastore_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,46 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :core) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-datastore_core"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "ElasticGraph gem containing the core datastore support types and logic."

spec.add_dependency "elasticgraph-schema_artifacts", eg_version
spec.add_dependency "elasticgraph-support", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "core" # used by script/update_codebase_overview
}

spec.add_development_dependency "elasticgraph-admin", eg_version
spec.add_development_dependency "elasticgraph-elasticsearch", eg_version
spec.add_development_dependency "elasticgraph-opensearch", eg_version
spec.add_development_dependency "elasticgraph-schema_definition", eg_version
# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION

spec.add_development_dependency "elasticgraph-admin", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-elasticsearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-opensearch", ElasticGraph::VERSION
spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION
end
36 changes: 33 additions & 3 deletions elasticgraph-elasticsearch/elasticgraph-elasticsearch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,42 @@
#
# frozen_string_literal: true

require_relative "../gemspec_helper"
require_relative "../elasticgraph-support/lib/elastic_graph/version"

ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, category: :datastore_adapter) do |spec, eg_version|
Gem::Specification.new do |spec|
spec.name = "elasticgraph-elasticsearch"
spec.version = ElasticGraph::VERSION
spec.authors = ["Myron Marston", "Ben VandenBos", "Block Engineering"]
spec.email = ["[email protected]"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "Wraps the Elasticsearch client for use by ElasticGraph."

spec.add_dependency "elasticgraph-support", eg_version
# See https://guides.rubygems.org/specification-reference/#metadata
# for metadata entries understood by rubygems.org.
spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/docs/main/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "datastore_adapter" # used by script/update_codebase_overview
}

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
# We also remove `.rspec` and `Gemfile` because these files are not needed in
# the packaged gem (they are for local development of the gems) and cause a problem
# for some users of the gem due to the fact that they are symlinks to a parent path.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"

spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
spec.add_dependency "elasticsearch", "~> 8.16"
spec.add_dependency "faraday", "~> 2.12"
spec.add_dependency "faraday-retry", "~> 2.2"
Expand Down
Loading
Loading