You can either add the blocks to the toplevel of the file or into the
main module. The blocks are given in separate files.
Test: Use both for some crates.
Change-Id: I74204867d4e348c83c7adc2a833be166956bfb7e
Env.cwd is misleading as it captures the location of the crate/package
being updated. Move the detection logic to the Package class and rename
the attribute.
There is the expectation that before running soong_ui, cwd is set to
ANDROID_BUILD_TOP; and before running write_mapping, that cwd is set to
the package directory. Add comments to capture this.
Test: update_crate_tests.py in external/rust/crates/libc
Change-Id: I5c4f16afe0b92b7c85173e4149ee17dd39c773c2
Rename the Crate class to Package as this script may also be used to
update TEST_MAPPING for the prebuilts/rust toolchain.
Inline get_tests function as one branch was never used.
Rename `create_test_mapping` to `create` as it is already a method of
TestMapping.
Test: update_crate_tests.py in external/rust/crates/libc
Test: update_crate_tests.py in prebuilts/rust
Change-Id: I06bd6d4f93223bb50fdb898980bd25fa3cea9019
Normalize the object initializations by raising exceptions and catching
them within main.
Test: update_crate_tests.py in external/rust/crates/libc
Change-Id: I6080fa7f22d740f5dd384c15ef74097e61dbb210
This allows you to give cargo2android.py a list of test files to ignore.
Test: Use on a couple crates.
Change-Id: Id9422c496de6693029754f32d9805f1cb92d33cb
A few crates have patches that manually remove a dependency that
cargo2android.py adds. This option can allow us to remove those
patches.
Test: Use when running on a few crates.
Change-Id: Ie8337789ab232fb726ccfe361df489acfdd31b20
This allows the external_updater to understand that an error occurred.
The pre-patched version of the file will still exist.
Test: Run when a patch fails.
Change-Id: I59cc12eeaa751b5e3e2956060f58981d27875748
This makes it easier to identify the directory where the coverage
report data of the latest `acov-llvm.py report` was written,
especially when the current directory already contains previous
coverage reports.
Test: acov-llvm.py report
Bug: 160401633
Change-Id: I96fc860940f5be11c4c3b702dfce74226afabfce
Currently if cargo produces an error it's not obvious how to debug it.
Add a message telling the user to look at the cargo.out file, which
has its output.
Test: Ran on crates with and without errors
Change-Id: Ib681a8e87f60467c7425aed5f7e5277a0603bcc8
Bug: http://b/160401633
Also:
- fix regexp to find clang prebuilt version to allow a suffix.
- call `adb root` before any operation.
Test: acov-llvm.py flush
Change-Id: I9287610ee2ccfec165b0a0bc2e3b24e0eb84ca31
This option is only intended to be temporary, so if it is used it
should not "propagate" itself by being added to the Android.bp header
or the config file.
Test: Do not see it in the header or config file.
Change-Id: Ibb18c76bdab26aa47b38ac75ea3c410ddc612856
Ensure that the script works on buildbots.
Test: adb shell debuggerd -b <pid> | development/scripts/stack
Change-Id: I3fd4a0ed78ff3245d1ab2f6e842446888c5c7b8b
This commit adds an --apex-available option to cargo2android.py. It
takes in multiple strings that are included in the generated block.
It also adds --min-sdk-version.
Test: Use flags.
Change-Id: I319a32fc5e8be11015ba4484b0ab1665ee457326
The command-line options to c2a are already long and will only get
longer as new arguments are added. This allows it to load them from a
config file. For simplicity of implementation, the config file
supplements the command-line arguments and uses the same format they
do, although it ideally will replace them over time.
This also adds an option to dump the current set of command-line
arguments to a config file and exit. This is intended to ease
migration over to the config file: for a given crate, we can call c2a
with its command-line arguments plus this new flag to generate the
config file and then use just that instead.
Test: Dump and load some config files.
Change-Id: I63b29dd20bcff5d5832dbd380d7c6eb273547ed0
Also hook up the test to Android.bp.
Test: unit test
Test: Ran with a tombstone file as parameter.
Test: Ran pasting in stack to stdin.
Change-Id: I25f40569cc49b7487553611bcc25d061179bfa8d
Generating a TEST_MAPPING file uses Bazel, which can be quite slow
(multiple minutes). Add a flag to allow skipping it. This is off by
default as it ideally will only be used for debugging.
Test: Run all four configurations of --tests and this flag.
Change-Id: I08bde29ea298fcf677addd86f6d953b6695e147f
The code that preserves license blocks currently also preserves
genrules if they come before a rust_ rule, causing them to be
duplicated. Let's fix that.
Test: Upgrade some crates
Change-Id: Ie4f62cd04c2f1dd0de788db0ca5e77502fb3b4c8
We currently seem to emit TEST_MAPPING files in an arbitrary order,
which causes diffs to look confusing even when nothing has changed.
Let's sort them by the test name, which is both stable and easier to
read.
Test: Run cargo2android multiple times and see no TEST_MAPPING diff.
Change-Id: I398aa84a4891380e4292223445bd53959c024421
This test looks like it basically never passed without this.
Test: Run cargo2android.py and see timeout.
Change-Id: Ic7ef5576efb84d78130dd45db67e50ebe41f6d9a
Bug: http://b/160401633
This is a tool for gathering coverage information from a device and
generating an LLVM coverage report from that information. See top of
the file for usage instructions.
Also redirect acov users to acov-llvm when CLANG_COVERAGE is set.
Test: acov-llvm.py wih clean-device, flush and report subcommands.
Change-Id: I5dba3a669bb6ac2797093903536f346228625c05