Commit graph

17 commits

Author SHA1 Message Date
Colin Cross
c85750bfe3 Use generics for DepSets
Use Go's generics for DepSets so they don't require a type-specific
wrapper and reflection.

Test: depsets_test.go
Change-Id: I22ba0b7d680d37d2cd05230b0f560d166c4dd20b
2023-06-22 08:18:33 -07:00
Cole Faust
c9508aac4c Load starlark files from soong
There are a number of instances where we are exporting information
from soong to bazel via soong_injection. This could be more bazel-centric
if the information was instead held in bzl files, and both bazel and
soong read it from there.

Add a starlark package that will run
//build/bazel/constants_exported_to_soong.bzl at initialization time,
and then results can be retreived with GetStarlarkValue.

Since changes to the starlark files mean that soong has to rerun,
add them as ninja deps.

Unfortunately, the starlark code has to be run at runtime rather than
pregenerating their results, because tests run from intellij wouldn't
go through any pregeneration steps. This means that starlark is run
multiple times during the build, once per test package and once per
primary builder invocation. (currently 3, could be reduced to 2 if we
made the symlink forest generation into its own standalone tool) The
starlark code we have so far in this cl is very fast, roughly half a
millisecond, so it's not a big deal for now, but something to keep an
eye on as we add more starlark constants.

Bug: 279095899
Test: go test
Change-Id: I1e7ca1df1d8d67333cbfc46e8396e229820e4476
2023-04-26 17:18:19 -07:00
Sasha Smundak
8756ae3702 Fix go.mod, add go.work to use local versions of the dependent modules.
Test: treehugger, (cd build/soong && go build ./...)
Change-Id: I22fd664b5dcc9f4691c5182fdf0dfe53abc0c584
2023-01-11 18:41:41 +00:00
Usta Shrestha
914bbebc13 go.mod readability improvement
Bug: N/A
Test: Verified by loading the project in IntelliJ
Change-Id: I9fa16fbea108436a52fc3bb4b39d9a2c1a73bee5
2022-11-15 21:35:39 -05:00
Jason Wu
118fd2b443 Rollforward "Use proto output instead of jsonproto output for aquery""
Test: use m --bazel-mode-dev and mixed_droid.sh
Bug: 233798334

This reverts commit d27e28c2a7.

Change-Id: Ifd37ac449979330529dd25c92a5eca2f5a80827e
2022-10-27 18:41:50 +00:00
Jason Wu
d27e28c2a7 Revert "Use proto output instead of jsonproto output for aquery"
This reverts commit 6fe8721e12.

Reason for revert: Broke aosp_kernel-build-tools/linux

Change-Id: I502ec4c275cbc56e1024a42fadf68b308750939d
2022-10-27 05:18:40 +00:00
Jason Wu
6fe8721e12 Use proto output instead of jsonproto output for aquery
Test: use m --bazel-mode-dev and mixed_droid.sh
Bug: 233798334
Change-Id: Ib945359d3d05e6f51afe70432ec380e4e584175b
2022-10-26 17:07:48 -04:00
Sam Delmerico
105a70418f Revert "add bp2build unit tests for aidl_interface"
This reverts commit 1fa2672be9.

Reason for revert: breaks tradefed branch

Change-Id: I69bba531774031890baece1796df24d5534b93a9
2022-08-29 22:24:10 +00:00
Sam Delmerico
1fa2672be9 add bp2build unit tests for aidl_interface
Bug: 229251008
Test: go test ./bp2build -run TestAidlInterface
Change-Id: Ie7214d5578bc21e348410ca91ea42d7a3190eb3d
2022-08-25 14:47:41 -04:00
Usta Shrestha
6298cc5e67 cosmetics: readability
Note go.mod file changes go version to 1.18 (for generics)
You might need to refresh/reload your IDE (e.g. IntelliJ)

Bug: N/A
Test: manually verified (e.g. ran `m nothing` successfully)
Change-Id: I2a6dadd673fd170961d1fd1e1756f7581e9a1091
2022-05-31 21:39:06 +00:00
Dan Willemsen
54d2e21fa8 go.mod: Add indirect exclusions/redirections from golang-protobuf upgrade
The golang-protobuf upgrade brought in new dependencies, which broke the
hermeticity of our go.mod redirections. Fix those up so they get
excluded or redirected to the locations in the tree.

Test: cd build/soong/cc; go test .
Change-Id: I012d11fad3b5509b213093e3c5889a27e641b868
2021-07-29 13:34:51 -07:00
Dan Willemsen
4591b6496d Upgrade to golang protobuf api v2
Major operations:
 * Fix the go_package entries to be consistent, as the new tool
   complains when it doesn't have a '/'.
 * Regenerate with the new protoc-gen-go tool.
 * github.com/golang/protobuf -> google.golang.org/protobuf
 * proto.[Un]MarshalText -> prototext.[Un]Marshal

Change-Id: Ie1147bd2457fafb66ba555461b3bf14f0561a25d
2021-07-23 11:12:05 -07:00
Colin Cross
3d4acddf56 Revert "Update soong's go.mod to 1.15.6"
This reverts commit 23f69ae958.

Reason for revert: invalid go version '1.15.6': must match format 1.23

Change-Id: Ibe4335f4d9b3ff4b08b4615b91935cca4643ee89
2021-01-08 01:28:29 +00:00
Jingwen Chen
23f69ae958 Update soong's go.mod to 1.15.6
Test: TH
Change-Id: I370e4a260cb6fb9fbd2d2da44964b51a339b90f5
2021-01-06 22:13:07 -05:00
Colin Cross
42f135b7b0 Update go.mod to go 1.15
The version in go.mod is used by `go build` to select the version
of the Go language to target.  If it is older than the version of Go
in the tree then command line tools like `go test` will give different
results from inside the build.  Update the version to match the version
of Go in the tree.

Test: go build ./java
Change-Id: I418f401580be7696e2829c970938c7c82715b932
2020-08-21 11:13:21 -07:00
Jaewoong Jung
5188e23903 Add go directive to indicate go version number.
Test: go vet ./...
Change-Id: I815bec9cba04f6c171f0ef5a3a909c4f5f28f6c2
2019-10-11 09:51:43 -07:00
Dan Willemsen
ee74203bfb Add go.mod file for go1.11
With this and go1.11beta2, the standard go tools can be used in
build/soong without creating a $GOPATH using something like
setup_go_workspace_for_soong.

Test: go vet android/soong/...
Change-Id: I3c69499b010c8f7f64666208efead4ddb3584b3c
2018-07-22 21:01:44 -07:00