Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
I'm building a macro which can take many types of things as arguments; both existing rules and raw source files.
By convention, as described in the Labels section of the manual, rules should be passed with the leading colon, so when calling my macro and passing a filegroup, I pass
srcs = ":my_srcgroup".When I try to determine if this is an existing rule or a file in my macro, I do:
Unfortunately, native.existing_rule does not understand the leading-colon syntax for rules, and therefore always returns false for any rule name starting with a
:I have a workaround but it's ugly: