aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lint-project-xml.py
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2020-06-23 10:25:26 -0700
committerColin Cross <ccross@android.com>2020-06-23 14:45:04 -0700
commit91edfc29c3fa54b8f55642724fc9e90397d225cc (patch)
tree521d0cd3c56535316181c52baf5ae63895c88843 /scripts/lint-project-xml.py
parentbca9028825d3130762e2b9cb6de4a8a7f85010b6 (diff)
downloadbuild_soong-91edfc29c3fa54b8f55642724fc9e90397d225cc.tar.gz
build_soong-91edfc29c3fa54b8f55642724fc9e90397d225cc.tar.bz2
build_soong-91edfc29c3fa54b8f55642724fc9e90397d225cc.zip
Set root dir in lint project.xml
Set the root dir in the project.xml for lint so that the paths in the lint report are relative to the top of the tree instead of relative to the project.xml. Bug: 153485543 Test: run lint Change-Id: Ie163a4dadd976e708f798855de73e58084931a91 Merged-In: Ie163a4dadd976e708f798855de73e58084931a91 (cherry picked from commit c31efeb25cac61fd3c2af3fed5bedeca2d401994)
Diffstat (limited to 'scripts/lint-project-xml.py')
-rwxr-xr-xscripts/lint-project-xml.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/lint-project-xml.py b/scripts/lint-project-xml.py
index 7ab4f015..38c57cad 100755
--- a/scripts/lint-project-xml.py
+++ b/scripts/lint-project-xml.py
@@ -77,6 +77,8 @@ def parse_args():
help='mark the module as a test.')
parser.add_argument('--cache_dir', dest='cache_dir',
help='directory to use for cached file.')
+ parser.add_argument('--root_dir', dest='root_dir',
+ help='directory to use for root dir.')
group = parser.add_argument_group('check arguments', 'later arguments override earlier ones.')
group.add_argument('--fatal_check', dest='checks', action=check_action('fatal'), default=[],
help='treat a lint issue as a fatal error.')
@@ -162,6 +164,8 @@ def write_project_xml(f, args):
f.write("<?xml version='1.0' encoding='utf-8'?>\n")
f.write("<project>\n")
+ if args.root_dir:
+ f.write(" <root dir='%s' />\n" % args.root_dir)
f.write(" <module name='%s' android='true' %sdesugar='full' >\n" % (args.name, "library='true' " if args.library else ""))
if args.manifest:
f.write(" <manifest file='%s' %s/>\n" % (args.manifest, test_attr))