If the build file contains the apex_test module, add the
testOnly attribute to the application element of the
corresponding AndroidManifest file and set its value to true.
If the testOnly attribute is already present and has value
false, then do nothing.
Tests added in manifest_fixer_test.py to check if the updated
AndroidManifest file has the testOnly attribute set to true or not.
Bug: 213310150
Test: atest --host manifest_fixer_test
Test: m nothing
Test: manually checked the AndroidManifest file generated
Change-Id: I36247dbe0261c342d451a4422c314fd8fe0c2369
mk2rbc was already searching the whole android tree
for Makefiles, so allowing variable-prefixed include
statements doesn't affect performance on the file searching
front. On the generated code front, there's already a cap
of 150 potentially-included makefiles that prevents the
performance from getting too bad, and it can be lowered
if necessary.
Bug: 213508006
Test: go test
Change-Id: I3a4e81acb3d97bee08ac3dbe63052a274acf5793
Marks the `scopeProperties.AnnotationsZip` property as only being
supported on T builds and above.
Bug: 204763318
Test: m nothing
Change-Id: Ie59396287c08da77a6a1f15d4be202429e011e17
Minor restructuring of the build_release pruning code to make it easier
to add logic for handling fields of maps of structs. That includes:
1. Moving some code that is specific to clearing a selected field
inside the associated if block.
2. Replacing an if with a switch.
3. Improving the error handling by separating the reporting of the
container that broke from information about which field could not be
set. That allows follow up code to provide information about the map
key instead.
The tests were restructed by:
1. Switching from using AssertDeepEquals to compare the structs to
comparing the output of marshalling the structs to JSON. That was
for a couple of reasons. Firstly, because JSON will marshal (and so
allow comparison of) the contents of pointers to structs whereas
AssertDeepEquals will just compare the pointers themselves.
Secondly, because JSON can pretty print the output and make it
easier to read.
2. Using a func to create a new instance of the input structure for
each test. That is to allow the test to modify the input structure,
e.g. by clearing a field in a struct that is pointed to by a map.
The test previously relied on the input structure being immutable
and passed by value but a follow up change will change that by
adding a map field that contains pointers to structs.
Bug: 204763318
Test: m nothing
Change-Id: I84dc99621497b7263e30466895b823eb02cb2b56
Adds support for traversing into a field that is of type:
map[...]*struct{...}
This is needed to allow java_sdk_library to mark scope specific
properties, e.g. public.annotations as being target build release
specific.
It was necessary to change the Scope field from:
Scope map[*apiScope]scopeProperties
to:
Scope map[*apiScope]*scopeProperties
That is because there is no way in go to change the field of a struct
value of a map. i.e. you cannot do the following, not even using
reflection:
Scope[apiScopePublic].AnnotationsZip = nil
Bug: 204763318
Test: m nothing
Change-Id: Id103f70f55d4202971321ef4925cbec4b55f8136
The expfetcher binary (added in
https://critique.corp.google.com/cl/424076941), can fetch experiments
configuration from CDPush and load them into Soong as part of its
startup. If the binary exists, then we use it to fetch experiments
config and put them in the out directory so that those env variables can
be loaded by Soong during startup and inturn control whether RBE should
be enabled or not.
Design doc: go/rbe-android-dev-gradual-rollout
Test:
1. time lunch aosp_bramble-userdebug (first lunch when "out" dir doesn't
exist) - https://paste.googleplex.com/5824218777255936 - took ~9s and
ran with RBE enabled.
2. time lunch aosp_bramble-userdebug (when "out" dir already exists) - https://paste.googleplex.com/6485045129773056 -
took ~3.5s and ran with RBE enabled.
3. time lunch aosp_bramble-userdebug (when
"vendor/google/tools/soong/expfetcher" doesn't exist) - https://paste.googleplex.com/6103083353374720 - took 6.5s
and not RBE enabled.
Bug: b/215181607
Change-Id: Ie3c085498c59929119534aa98863566eecb8e4eb
This only supports the `jars` property/attribute.
Test: b build external/error_prone:error_prone_core_jars
Bug: 215229744
Change-Id: If0d9c8c4e9c1c560d35a501c20bef9361ef45e15
The module name passed to rbld.inherit should be its path without the suffix.
Bug: 215182113
Test: internal
Change-Id: Ic65a5b73037be84f31f8db29f71f793b6c6034bb
Use the new license metadata files to generate the notice files
for sdk_repo modules.
Bug: 207445310
Test: m sdk_repo_build_tools
Change-Id: I8079061fbdf7417c94eebbb1b31486d3f506f931
Containers generally package the transitive installable
dependencies of their direct dependencies, track them as license
deps.
Bug: 207445310
Test: m checkbuild
Change-Id: Ic8640152cee0e0cfec5e85a1649a8adfd29d517a
It might be useful to associate other library names than "Android"
with the Apache 2.0 license text.
Test: m nothing
Change-Id: I3ccbd9ca77f330bb81bf2bf4ec53cfb873befe8b
VariableDefinedExpr was under-developed, and would not
take into account if a variable was from the globals
or product config dictionary.
It also always emitted `g.get("VARIABLE") != None`, which
is not correct behavior. In this example makefile:
```
MY_VAR :=
ifdef MY_VAR
$(info MY_VAR is defined)
else
$(info MY_VAR is not defined)
endif
ifdef MY_UNDEFINED_VAR
$(info MY_UNDEFINED_VAR is defined)
else
$(info MY_UNDEFINED_VAR is not defined)
endif
MY_VAR ?= true
MY_UNDEFINED_VAR ?= true
$(info MY_VAR after ?= is $(MY_VAR))
$(info MY_UNDEFINED_VAR after ?= is $(MY_UNDEFINED_VAR))
.PHONY: all
all:
@:
```
We get the output:
MY_VAR is not defined
MY_UNDEFINED_VAR is not defined
MY_VAR after ?= is
MY_UNDEFINED_VAR after ?= is true
So we can see that even if a variable was set, it's considered
not defined if it was set to an empty value. However, ?= works
differently, and does require the != None, so that was left
as is.
Just use a variableRefExpr and rely on the fact
that variables will be truthy if they're defined.
Fixes: 216700361
Test: go test
Change-Id: If8944da2579e8658e3fc4f666b1f3b2815f8c8b1
javac is generally a short-lived JVM invocation that doesn't greatly
benefit from deep JIT tiering. As such, favor faster startup time
by limiting to tier 1 JIT for javac execution. This should greatly
reduce overall CPU usage from Java compilation for an arbitrary
Android build (~20%), and deliver a small but modest improvement in
overall Java build times (~5%).
Representative incremental build times with this change:
* real 18m3.507s
* user 563m4.838s
and without:
* real 19m11.909s
* user 751m27.790s
Follow-up changes will apply similar flags for other short-lived JVM
build commands.
Bug: 205303544
Test: m
Change-Id: Ic6315b976063f4330902930a6cf5e5cb394c554c
This change is similar to aosp/1947127, but for prebuilts.
After this change, if `bootImageConfig.installDirOnDevice` is set to a
path outside of the APEX, the build system will build a boot image from
the dex files and the profile extracted from the prebuilt APEX.
Otherwise, it keeps the current behavior: extracting the boot image from
the prebuilt APEX.
This is a no-op change. Current behavior is not affected.
Bug: 211973309
Test: m nothing
Test: -
On internal master:
1. Patch aosp/1947128.
2. Patch ag/16743847 and ag/16746804.
3. m SOONG_CONFIG_art_module_source_build=false com.google.android.art
4. See the boot image being installed in `/system/framework/<arch>`.
Change-Id: I24ca525309fecaf3ab7a67960fbf118cd00ecd1d
* changes:
Support building rust modules against musl libc
Support genrules as CrtBegin and CrtEnd in rust
Support multiple crtbegin and crtend dependencies
Add "btf" option that generates BTF debug info to support easier map
inspection. This is accomplished by passing the "-g" flag to clang
when compiling the BPF program.
The "-g" option also generates a number of DWARF debug sections which
are not necessary for loading BTF information, so strip these to avoid
increasing file size unnecessarily. bpfloader currently only supports
BTF info for maps, not programs, so we also strip the .BTF.ext section
containing program BTF info.
Bug: 203823368
Test: libbpf_load_test
Test: verify time_in_state.o includes .BTF section iff "btf: true" is
set
Test: verify time_in_state.o still loads if BTF is enabled
Change-Id: Ica25b253bace59d04130b0210350188399889bbe
Signed-off-by: Connor O'Brien <connoro@google.com>