Skip to content

Commit 7bac285

Browse files
author
Konstantin Gredeskoul
committed
WIP: attempt to intro gemspec file for local gems
Does not currently work yet :(
1 parent 9dd48ea commit 7bac285

File tree

4 files changed

+10
-31
lines changed

4 files changed

+10
-31
lines changed

README.md

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

409409
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
410410

411-
http://www.apache.org/licenses/LICENSE-2.0
412-
413-
### Warranty
411+
<http://www.apache.org/licenses/LICENSE-2.0>
414412

415413
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
416414
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/def.bzl

Lines changed: 0 additions & 22 deletions
This file was deleted.

ruby/private/bundle/bundle.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def _get_bundler_lib_label(repository_ctx, ruby_sdk):
1515
def bundle_install_impl(ctx):
1616
ctx.symlink(ctx.attr.gemfile, "Gemfile")
1717
ctx.symlink(ctx.attr.gemfile_lock, "Gemfile.lock")
18+
if ctx.attr.gemspec:
19+
print(ctx.attr.gemspec)
20+
print(ctx.path(ctx.attr.gemspec).basename)
21+
ctx.symlink(ctx.attr.gemspec, ctx.path(ctx.attr.gemspec).basename)
1822

1923
ruby = _get_interpreter_label(ctx, ctx.attr.ruby_sdk)
2024
bundler = _get_bundler_label(ctx, ctx.attr.ruby_sdk)
@@ -64,6 +68,9 @@ bundle_install = repository_rule(
6468
"gemfile_lock": attr.label(
6569
allow_single_file = True,
6670
),
71+
"gemspec": attr.label(
72+
allow_single_file = True,
73+
),
6774
"excludes": attr.string_list_dict(
6875
doc = "List of glob patterns per gem to be excluded from the library",
6976
),

ruby/private/tools/deps.bzl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ load(
66

77
def _transitive_srcs(deps):
88
return struct(
9-
srcs = [
10-
d[RubyLibrary].transitive_ruby_srcs for d in deps if RubyLibrary in d
11-
],
12-
incpaths = [
13-
d[RubyLibrary].ruby_incpaths for d in deps if RubyLibrary in d
14-
],
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],
1511
rubyopt = [d[RubyLibrary].rubyopt for d in deps if RubyLibrary in d],
1612
data_files = [d[DefaultInfo].data_runfiles.files for d in deps],
1713
default_files = [d[DefaultInfo].default_runfiles.files for d in deps],

0 commit comments

Comments
 (0)