commit | f73b9632839caf94e12a046d0aeaac7e64375296 | [log] [tgz] |
---|---|---|
author | Mårten Kongstad <amhk@google.com> | Wed May 24 15:43:47 2023 +0200 |
committer | Mårten Kongstad <amhk@google.com> | Thu May 25 16:18:59 2023 +0200 |
tree | 3678f45965520eafde2e0bc7c072cd1112c156d3 | |
parent | 993111f91c7cb12392666e6694006710924ccfde [diff] |
aconfig: first iteration of Rust codegen Add a new `create-rust-lib` command to generate Rust code. The output is a src/lib.rs file; the build system is assumed to set the generated crate's name. For READ_ONLY flags, the generated code returns a hard-coded true or false. For READ_WRITE flags, the generated code reaches out to DeviceConfig via the cc_library server_configurable_flags via the libprofcollect_libflags_rust Rust bindings. The build system is assumed to add this to the generated crate's dependencies. Note: libprofcollect_libflags_rust seems generic enough that it should be moved to an official Rust wrapper for server_configurable_flags. This is tracked in b/284096062. Summary of module the built system is assumed to wrap the auto-generated code in: rust_library { name: "lib<namespace>_rs", crate_name: "<namespace>_rs", edition: "2021", clippy_lints: "none", no_stdlibs: true, lints: "none", srcs: ["src/lib.rs"], rustlibs: [ "libprofcollect_libflags_rust", ], } Also add a set of test input to be used in the unit tests for a more coherent test strategy. A follow-up CL will migrate the code in commands.rs, codegen_java.rs and codegen_cpp.rs. Bug: 279483360 Bug: 283907905 Test: atest aconfig.test Test: manual: create cache from files in testdata, create rust lib, add to module template above, verify the module builds Change-Id: I02606aa3686eda921116e33f7e2df8fd1156a7aa
This is the Makefile-based portion of the Android Build System.
For documentation on how to run a build, see Usage.txt
For a list of behavioral changes useful for Android.mk writers see Changes.md
For an outdated reference on Android.mk files, see build-system.html. Our Android.mk files look similar, but are entirely different from the Android.mk files used by the NDK build system. When searching for documentation elsewhere, ensure that it is for the platform build system -- most are not.
This Makefile-based system is in the process of being replaced with Soong, a new build system written in Go. During the transition, all of these makefiles are read by Kati, and generate a ninja file instead of being executed directly. That's combined with a ninja file read by Soong so that the build graph of the two systems can be combined and run as one.