Fix syntax error in auto-generated Rust code that prevents the code from
compiling.
For reference, the error was:
---- 8< ----
error: expected `where`, `{`, `(`, or `;` after struct name, found keyword `impl`
--> .../src/lib.rs:6:1
|
6 | impl FlagProvider {
| ^^^^ expected `where`, `{`, `(`, or `;` after struct name
---- >8 ----
Bug: 292052163
Test: manual: create sample based on auto-generated Rust lib
Change-Id: I4c029c0ee16ea3849e7bbe381717a10402c9cb81
Add a new --format=verbose dump output format. This is identical to the
default 'text' format but includes the source files from which the flag
declaration and values were read, and is intended to help debug why a
flag isn't set to some expected value.
Bug: 283910447
Test: atest aconfig.test
Test: printflags --format=verbose # manually inspect output
Change-Id: I03a1c8d940e7a0c6f91e986c5bafa4aa6cd1125a
The --format=debug dump output format is largely superseded by the
textproto format now that aconfig doesn't use hand-written wrappers
around the auto-generated proto struct anymore. Remove the format to
reduce the risk of code rot.
Bug: 283910447
Test: atest aconfig.test
Change-Id: I6700fc4eafd3fa3a63952109c0105d34c7ffd98b
This change will sorted the parsed flags from the declarations. Without
this change the code will expect the passed in declarations sorted.
After this change the code will still guarantee the parsed flags in the
cache is sorted, but it won't expect the passed in declarations are
sorted
Test: atest aconfig.test
Bug: 291926035
Change-Id: I5f0637fe770003224b128591890e04277bc09345
Introduce rust codegen 2nd iteration with unit test support. The design
is described in detail in the design doc (go/aconfig_rust_codegen). The general idea is to generate
different code with the same signature for production and test build
targets, just like java/c/cpp codegen.
We will have a FlagProvider struct that has flag methods implementation.
This flag provider instance can then be used in injection pattern. In
additon, we also generate top level functions that wraps around flag
provider call so it can be used in static function style.
Things to be decided later:
should we just generate one set of code, and use cfg! as compile
time marco to compile the right code for the right targets.
Bug: b/279483360
Test: atest aconfig.test
Change-Id: Ic75cedbd0d27b5242014c3ac7fc80692d2ab4589
For the OTA build, target_files.zip requires setting fixed timestamp
for images. However, it caused regression on 'adb sync'.
Restoring image build process for target_files.zip instead of copying
them from the PRODUCT_OUT, only the images in target_files.zip set the
fixed timestamp.
By setting COPY_IMAGES_FOR_TARGET_FILES_ZIP flag, we still may copy
the images for target_files.zip for future use.
Bug: 287534409
Test: m; flashall; adb sync
Test: m dist; flash images from target_files.zip and check the timestamp
Change-Id: I4135eb721c33581f191621847e6595833263d707
1, Moved "#include <string>" from exported header to test flag provider
header file.
2, For production target and read only flags, the generated c
api should just return default value instead of calling into c++ api
3, Remove using namespace server_configurable_flags from header, instead
of just having the namespace to be spelled out in each api call. Having
using namespace xxx in header is not a c++ best practice.
4, Replace #ifdef #def #endif with #pragma once
Bug: b/279483801
Test: atest aconfig.test
Change-Id: I3e55a7b14301f3de419795467f33e2dc889d371e
Two major changes to c/c++ codegen
(1) explicit setter for each flag instead of a generic flag setter
void override_flag(std::string name, bool val) is replaced with
void <flag name>(bool val) for each flag name
This has several advantages:
(a) generated code is more c++ idomatic
(b) no longer need to create flag name string constants
(c) any typo in the code is caught early in the build time
(2) remove flag setter and flag override reset methods/functions when
generating code targets for production. If developers want to update
their main function to take command line arg for flag overrides, they
can use compile time macros to decide if the flag override code should
be included.
Bug: b/279483801
Test: atest aconfig.test
Change-Id: I6141f7f979b32fe0426154d578edeb997ae5ff7c
Add a new flag variable for deprecating VNDK. This variable should be
passed to Soong, so it can change behavior based on the flag.
Bug: 290157355
Test: build succeeded with KEEP_VNDK=false
Change-Id: I3a9d1041411ad24ff42f76506a8f929e364b868d
Previously, the "sdk" target was a minimal lunch target that only
included enough to build the sdk. But the "sdk_<arch>" targets
redirected to the "sdk_phone_<arch>" targets, which are much bigger
and capable of building a whole emulator.
Building the sdk on products that can build a whole device complicates
the rest of the build system (for example, it starts enforcing dexpropt
works)
Bug: 290798660
Test: Presubmits
Change-Id: I0ec5110318c43a7feee0b88edbed1cab0b590a47
If adb is not found on PATH, which will silently fail and evaluate to
the empty string. This will cause the remaining arguments to be
interpreted as a command to run in the shell, which is generally
undesirable. (Consider, for example, "adb reboot" -> "reboot".)
Bug: 24473359
Test: Just run adb before lunch so it's not on PATH
Change-Id: I6b20722add6c67d1d2627f963dc66095502ab816
Signed-off-by: Saagar Jha <saagarjha@google.com>
c codegen can be done at the same time with cpp codegen, the idea is to
create a c compatible header that defines the flag apis, including flag
override apis for test. then in the corresponding cpp file, the
implementation simply calls into cpp api.
c header supports static method interface, and unit test override, but
it does not support injection pattern compared to cpp header
Bug: b/279483801
Test: atest aconfig.test
Change-Id: Ie62b76d6524e443de5d3c2f9000f7f66623ab571
* changes:
Do not install required modules from order-only deps
Install vintf_fragments/init_rc along with targets
Install vintf_fragments even when they are shared
Master branch has been renamed to main, the build id needs to reflect
this change.
Ignore-AOSP-First: Merge conflict resolutions
Bug: 290400015
Change-Id: I77884da7587fecae362f9c82fee9f45ff9878cc0
Merged-In: Ieb8b84d340f2308255ad2f23e5ac23635fb680de
Merged-In: Ife1860b73bc83d32a61817d5a9fe25c2deb1e37d
Merged-In: I132433a625848a210603a2e0ad102c12435b3ba4
Merged-In: I740ef3225c4c291ef7313d3ff1fe5d78389497f5
metalava no longer prints an ASCII banner, and has removed its
--no-banner argument. Update all call sites accordingly.
Test: presubmit
Bug: 286023667
Change-Id: I0159cad6571c62d672da5aeb3ff422abb97c7ac9