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

Enabled abbreviation syntax for subrepos, ticket 386 #389

Merged
merged 4 commits into from Aug 15, 2018
Merged

Conversation

BNMetrics
Copy link
Contributor

  • now supports abbreviation syntax for build target with the same subrepo and package name. for example: @unittest_cpp//:unittest_cpp can be shortened to @unittest_cpp
  • Also added documentation in subrepo section

Copy link
Member

@peterebden peterebden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

<p>If the subrepo and the package names are the same, for example, <code>@unittest_cpp//:unittest_cpp</code>,
the build label reference to the target can be abbreviated, like so:</p>

<pre><code>subinclude("@pleasings//go:go_bindata")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the subinclude bit, it's not really germane to the example

targetNewSyntax := "@unittest_cpp"
pkg, name, subrepo := parseBuildLabelParts(target1, "/", nil)
pkg2, name2, subrepo2 := parseBuildLabelParts(targetNewSyntax, "/", nil)
assert.Equal(t, pkg, pkg2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably better to assert the values directly; technically you could pass this test with an implementation that always returned "" for the subrepo for example.

@peterebden peterebden merged commit daa25a1 into master Aug 15, 2018
@peterebden peterebden deleted the luna2 branch August 15, 2018 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants