首页 > 解决方案 > 如何正确清理模块并在 AOSP 中重建它?

问题描述

AOSP 的顶层目录是~/WORKING_DIRECTORY。如果我跑

~/WORKING_DIRECTORY$ make

整个系统构建正确。

根据Building a specific module in the android source codehttps://stackoverflow.com/a/30671099/746461,如果我需要重建艺术,我会

cd art
mm

但是它会引发错误:

FAILED: out/target/common/cpplint/art__compiler__optimizing__nodes.h 
/bin/bash -c "(art/tools/cpplint.py --quiet --root=. --filter=-whitespace/line_length,-build/include,-readability/function,-readability/streams,-readability/todo,-runtime/references,-runtime/sizeof,-runtime/threadsafe_fn,-runtime/printf art/compiler/optimizing/nodes.h ) && (mkdir -p out/target/common/cpplint/ ) && (touch out/target/common/cpplint/art__compiler__optimizing__nodes.h )"
art/compiler/optimizing/nodes.h:3974:  Labels should always be indented at least one space.  If this is a member-initializer list in a constructor or the base class list in a class definition, the colon should be on the following line.  [whitespace/labels] [4]
art/compiler/optimizing/nodes.h:3978:  Labels should always be indented at least one space.  If this is a member-initializer list in a constructor or the base class list in a class definition, the colon should be on the following line.  [whitespace/labels] [4]
art/compiler/optimizing/nodes.h:3983:  Labels should always be indented at least one space.  If this is a member-initializer list in a constructor or the base class list in a class definition, the colon should be on the following line.  [whitespace/labels] [4]
art/compiler/optimizing/nodes.h:3987:  Labels should always be indented at least one space.  If this is a member-initializer list in a constructor or the base class list in a class definition, the colon should be on the following line.  [whitespace/labels] [4]
art/compiler/optimizing/nodes.h:3992:  Labels should always be indented at least one space.  If this is a member-initializer list in a constructor or the base class list in a class definition, the colon should be on the following line.  [whitespace/labels] [4]
art/compiler/optimizing/nodes.h:3996:  Labels should always be indented at least one space.  If this is a member-initializer list in a constructor or the base class list in a class definition, the colon should be on the following line.  [whitespace/labels] [4]
Done processing art/compiler/optimizing/nodes.h
Total errors found: 6
[  1% 108/10017] Building with Jack: out/ho...S/core-oj-hostdex_intermediates/classes.dex
ninja: build stopped: subcommand failed.
17:27:03 ninja failed with: exit status 1

#### failed to build some targets (13 seconds) ####

如果我留在 ~/WORKING_DIRECTORY 并调用 mm art,它似乎构建正确。

但是,如果我故意在源代码中出错,则运行

~/WORKING_DIRECTORY$ mm art

它仍然在构建,这意味着新文件根本没有被编译。请参阅屏幕截图。

在此处输入图像描述

重建模块的正确方法是什么?

标签: android-source

解决方案


模块清洗:

cd $ANDROID_BUILD_TOP
make clean-module_name

艺术项目有多个目标模块。您应该为它们一一使用清洁。


推荐阅读