Commit graph

3 commits

Author SHA1 Message Date
Sasha Smundak
d5fc469dd8 If invoked 'go list' command fails, show its stderr.
Test: manual
Change-Id: I776b71f8b6c6c3d46d60e790d944282efd6d55d7
2022-04-19 11:32:28 -07:00
Dan Willemsen
64e61e1a64 go2bp: Add -limit and -skip-tests to more easily limit imported modules
I wrote these flags primarily for build-tools:external/kythe, where we
only use a subset of the Go packages defined in the project.

-limit allows defining the entry points to keep in the Android.bp, and
the utput will omit everything except those entry points and their
dependencies. This allows the kythe Android.gen.bp file to drop from 195
modules to 31 using two flags, without having to manually exclude the
other 160 packages.

-skip-tests does as you'd expect, though ideally it wouldn't be
necessary. We didn't import all of the test-only dependencies for kythe
into the source tree, so we're not able to build them.

Change-Id: I49e9f12dac53a74c6e05725ee41fb7c0ed8b0cbb
2021-07-12 21:46:02 -07:00
Dan Willemsen
beb51ac64c Add go2bp tool
This tool automatically writes Android.bp files based on information
discovered from Go, similar to pom2bp or Bazel's Gazelle. This
implementation is fairly limited, but is usable enough to import
libraries like protobuf without a lot of manual effort.

Change-Id: Iecc145bc7ab9b9e9c3739f77b694b3f4bc2c6396
2021-05-24 16:06:52 -07:00