| Age | Commit message (Collapse) | Author |
|
This is cherry pick of aosp/2924191 to avoid merge conflict in git main
Previously, aconfig repo is the root directory of aconfig binary crate,
but it also hosts printflags crate inside, and there is no cargo support
for printflags binary crate. In addition, with more aconfig development,
more crates are being added to this repo. Thus this repo should be
configured as a Cargo workspace with multiple crates rather than a
single crate.
Note the top level Cargo.toml file specifies the crates this workspace
carries:
(1) aconfig_protos: the proto library crate that will be used by many other
crates such as aconfig binary crate and printflags binary crate
(2) aconfig: the aconfig binary crate
(3) printflags: the printflags binary crate
(1) aconfig_protos crate setup:
Inside aconfig_protos dir we set up the aconfig_protos crate, the
previously src/proto.rs is now aconfig_protos/src/lib.rs, the build.rs
is carried over to this crate.
(2) aconfig binary crate setup:
Notice its Cargo.toml file claims package dependency on aconfig_protos
crate. It no longer carries proto related module and build.rs file.
(3) printflags binary crate setup:
Similary, notice that in its Cargo.toml file, it claims package
dependency on aconfig_protos crate.
With this setup, we can Cargo build/test each crate individually when
inside a specific crate dir. But we can also run Cargo build/test at
repo root level, which will build/test all the crates in this workplace.
This is the structuring cl. The next cl is to move storage modules into
its own library crate. This storage file library crate will be used by
both aconfig binary crate as well as flag read library crate (to be
created as another new crate here).
Bug: b/321984352
Test: top and individual crate dir level Cargo build/test, m each
individual targets
Ignore-AOSP-First: cherrypick to git main to resolve merge conflict
Change-Id: I75833f4997f7ee554ff6c1557df9ac87f62b2732
|
|
|
|
str::split always returns at least one item (the entire string) if the
delimiter is not found. Simplify the implementation of
is_valid_container accordingly.
Bug: N/A
Test: atest aconfig.test
Change-Id: I3e92035309a7b019912710e42e69f9bdfa538795
|
|
Bug: N/A
Test: atest aconfig.test
Change-Id: I248acae172fdeeb9ab9c4bb922f36b560cb44787
|
|
|
|
|
|
This commit adds ForceReadOnly mode to rust codegen.
Bug: 316357759
Test: atest aconfig.test aconfig.prod_mode.test.rust
aconfig.test_mode.test.rust aconfig.exported_mode.test.rust
aconfig.force_read_only_mode.test.rust
Change-Id: I4cf98a6e9fc908fc372d4e68098a516808718c57
|
|
This commit adds ForceReadOnly mode to java codegen.
Bug: 316357759
Test: atest aconfig.test aconfig.test.java
Change-Id: I10cd60def9ea20f7d56d87d18f680afeac61dc9d
|
|
This commit adds ForceReadOnly mode to c/c++ codegen.
Bug: 316357759
Test: atest aconfig.test aconfig.test.cpp aconfig.test.cpp.test_mode
aconfig.test.cpp.exported_mode aconfig.test.cpp.force_read_only_mode
Change-Id: I4842dd69993fe4fc1f504358f59513cf064919d9
|
|
The "force_read_only" mode is designed for libraries shared among
multiple containers for the following two scenarios where:
1. The library must be built with read_only flags or
2. Different containers requires different values for the same flags.
In this mode, the library includes only non-exported flags, adhering to
the concept that exported flags should maintain consistent values across
containers. Additionally, regardless of their original permissions, all
flags within this mode will be set to read_only.
Bug: 316357759
Test: atest aconfig.test
Change-Id: I65df39416c96404d84044a46bbcfe1bc8ce9ba8f
|
|
Before this change java codegen filter flags for exported mode in the
template. This change move the filter process to commands as other
codegen. Thus the codegen code will only generate code based on the
passed in flags.
Bug: 311152507
Test: atest aconfig.test aconfig.test.java AconfigJavaHostTest
Change-Id: I74045709cde19e6c687c3eb0d94050ea40cf5042
|
|
This commit changes modify_parsed_flags_based_on_mode to return Result
instead of vector. This change will have two consequences.
1. Error will be thrown if no flags fit into the current codegen mode
2. Error will be thrown if the flag declaration is empty
Bug: 311152507
Test: atest aconfig.test
Change-Id: I69b9a84312faed9f757bf3974b3cea49c5c5e285
|
|
This change moves CodegenMode to codegen crate.
Bug: 311152507
Test: ateset aconfig.test
Change-Id: I4f64cdbdc3d1b419412012560bfe03344b2b8faf
|
|
This commit adds exported mode to rust codegen.
When the codegen mode is exported
1. only flags with exported: true will be generated
2. the generated getter should be in a read_write format and with
default value as false, regardless the original permission and state
of the flag
This commit adds integration test for rust codegen exported mode.
Bug: 316357104
Test: atest aconfig.test aconfig.test_mode.test.rust aconfig.exported_mode.test.rust
Change-Id: Ib7dae666e13eb8898289b06d42a4f89326e175c4
|
|
This commit adds a new testing flag enabled_fixed_ro_exported to test
the case of a exported and fixed_read_only flag.
Test: atest aconfig.test aconfig.test.java AconfigJavaHostTest
aconfig.test.cpp aconfig.test.cpp.test_mode aconfig.prod_mode.test.rust
Bug: 316357680
Change-Id: Iaedb8a6875166c6a6d24c7c3deee701a496b4964
|
|
This commit adds exported mode to c/c++ codegen.
When the codegen mode is exported
1. only flags with exported: true will be generated
2. the generated getter should be in a read_write format and with
default value as false, regardless the original permission and state
of the flag
This change moves process parsed_flags funciton into codegen crate. The
process function is used to process parsed_flags based on the codegen
mode.
The template has also modified to keep readability.
Bug: 316357680
Test: atest aconfig.test aconfig.test.cpp aconfig.test.cpp.test_mode
Change-Id: I511e05ab93b07a04236055d956d1926f4ed89f36
|
|
1, Current codegen would still include an empty flag value cache even if
there are no read write flags. This is important as the flag value cache
is a std::vector. Thus adding this cache would automatically pull in
libc++ dependency which we should not.
2, There lacks of c/c++ codegen unit tests to lock down the generated
code when a flag package contains only read only flags. It should not
include server_configurable_flags header. And it should not include the
flag cache.
Bug: b/316614694
Test: atest aconfig.test
Change-Id: Iee4366672932ee507694f5fc73b526c66fcf0e9b
|
|
Pass ownership of the ProtoParsedFlag iterator items to the Java
codegen: this removes the need for an explicit lifetime annotation.
Bug: N/A
Test: atest aconfig.test
Change-Id: I78705b65b4cf41c3e23b59afbd122a029ee45df4
|
|
Pass ownership of the ProtoParsedFlag iterator items to the C++ codegen:
this removes the need for an explicit lifetime annotation.
Bug: N/A
Test: atest aconfig.test
Change-Id: Ic6606a9ab01ddcb61aa668d7ac901469b1e25a1f
|
|
Pass ownership of the ProtoParsedFlag iterator items to the Rust
codegen: this removes the need for an explicit lifetime annotation.
Bug: N/A
Test: atest aconfig.test
Change-Id: Ia37ff9f1238684ea31cda6be70acde54fdb04881
|
|
FakeFeatureFlagsImpl still generated all flags in its mFlagMap field, but it should generate only exported flags in exported mode.
Test: atest aconfig.test.java
Bug: 311152507
Change-Id: I61843cd87b3bb5035772791a5869a91b07d574d8
|
|
Test: atest aconfig.test
Bug: 311152507
Change-Id: I960867d32415007db5dacab57e97b813cbbee650
|
|
Consolidate the code generation sources into its own module. This is
done in preparation for when support for the new flag storage will be
added, which should also be placed in a separate module.
Bug: N/A
Test: atest aconfig.test aconfig.test.java
Change-Id: I8246729218ec60f2af4568c460e98329665a89fa
|