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

Add native-android fix to buildifier #638

Merged
merged 9 commits into from
May 21, 2019
Merged

Add native-android fix to buildifier #638

merged 9 commits into from
May 21, 2019

Conversation

timpeut
Copy link
Contributor

@timpeut timpeut commented May 17, 2019

Also fixes a bug where the same global would be loaded multiple times.

Copy link
Member

@vladmos vladmos left a comment

Choose a reason for hiding this comment

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

Thanks, could you please also modify the WARNINGS.md file? Warning messages point to it as a documentation page.

@timpeut
Copy link
Contributor Author

timpeut commented May 20, 2019

Done

warn/warn_bazel_api.go Outdated Show resolved Hide resolved
WARNINGS.md Outdated Show resolved Hide resolved
@vladmos
Copy link
Member

vladmos commented May 20, 2019

Sorry, I've just realized: your fix will work for BUILD files, but in .bzl files the usage you need to match is not just android_library but native.android_library (and the other functions as well). In that case you'll need to both add a load and replace the node with a simple function call.

An example fix that matches native.<something>: https://github.com/bazelbuild/buildtools/blob/master/warn/warn_bazel.go#L47 . You'll basically need to do the same but in .bzl files, and you should only match CallExpr nodes with the X attribute equal to native.<your function> (which is a DotExpr node with X == Ident (Name == "native") and Name == "your_function_name".

@timpeut
Copy link
Contributor Author

timpeut commented May 20, 2019

Added support for native.X

@vladmos vladmos merged commit 89c8254 into bazelbuild:master May 21, 2019
cristiancreteanu pushed a commit to cristiancreteanu/buildtools that referenced this pull request Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants