Skip to content

Commit 3a33240

Browse files
author
Konstantin Gredeskoul
committed
Merge branch 'kig/bundle-with-gemspec' into develop
2 parents a7fcdaf + 7bac285 commit 3a33240

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,7 @@ bundle_install(name, gemfile, gemfile_lock)
418418

419419
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
420420

421-
http://www.apache.org/licenses/LICENSE-2.0
422-
423-
### Warranty
421+
<http://www.apache.org/licenses/LICENSE-2.0>
424422

425423
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
426424
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

ruby/private/bundle/bundle.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def bundle_install_impl(ctx):
1616
ctx.symlink(ctx.attr.gemfile, "Gemfile")
1717
ctx.symlink(ctx.attr.gemfile_lock, "Gemfile.lock")
1818
ctx.symlink(ctx.attr._create_bundle_build_file, "create_bundle_build_file.rb")
19+
if ctx.attr.gemspec:
20+
ctx.symlink(ctx.attr.gemspec, ctx.path(ctx.attr.gemspec).basename)
1921

2022
ruby = _get_interpreter_label(ctx, ctx.attr.ruby_sdk)
2123
bundler = _get_bundler_label(ctx, ctx.attr.ruby_sdk)
@@ -86,6 +88,9 @@ bundle_install = repository_rule(
8688
"gemfile_lock": attr.label(
8789
allow_single_file = True,
8890
),
91+
"gemspec": attr.label(
92+
allow_single_file = True,
93+
),
8994
"excludes": attr.string_list_dict(
9095
doc = "List of glob patterns per gem to be excluded from the library",
9196
),

ruby/private/tools/deps.bzl

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@ load(
55
)
66

77
def _transitive_srcs(deps):
8-
return struct(
9-
srcs = [
10-
d[RubyLibrary].transitive_ruby_srcs
11-
for d in deps
12-
if RubyLibrary in d
13-
],
14-
incpaths = [
15-
d[RubyLibrary].ruby_incpaths
16-
for d in deps
17-
if RubyLibrary in d
18-
],
19-
rubyopt = [d[RubyLibrary].rubyopt for d in deps if RubyLibrary in d],
20-
data_files = [d[DefaultInfo].data_runfiles.files for d in deps],
21-
default_files = [d[DefaultInfo].default_runfiles.files for d in deps],
22-
)
8+
return struct(
9+
srcs = [d[RubyLibrary].transitive_ruby_srcs for d in deps if RubyLibrary in d],
10+
incpaths = [d[RubyLibrary].ruby_incpaths for d in deps if RubyLibrary in d],
11+
rubyopt = [d[RubyLibrary].rubyopt for d in deps if RubyLibrary in d],
12+
data_files = [d[DefaultInfo].data_runfiles.files for d in deps],
13+
default_files = [d[DefaultInfo].default_runfiles.files for d in deps],
14+
)
2315

2416
def transitive_deps(ctx, extra_files = [], extra_deps = []):
2517
"""Calculates transitive sets of args.

0 commit comments

Comments
 (0)