Improve GN header checker, make "check" on //ui/* pass.

I went through and made "gn check //ui/*" pass, and did a lot of enhancements for the bugs I found.

Fixes a big bug in the header checker where it did not consider direct private dependencies to be OK from a header include perspective. However, private deps only change things when there are intermediate targets. This patch marks direct deps OK, and changes the variable names from is_public to is_permitted (since it may not actually be public).

Allow includes to be permitted if any target allows the include, rather than all of them. This happens if multiple targets have the same file as sources.

Strip the generated file directory from the beginning of sources. Previously, this was only for outputs (since typically they're included assuming the root gen dir is on the path). This comes up when an action generates a file, and then it's put into a source set (which we do a lot). This change allows a public dependency on the source set to count for header include purposes.

Track public/private deps in the dependency path finder so the error message can show which deps are private that break the chain. This was really helpful when tracking down errors.

Add deps and public deps to the build to make check pass.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/584683002

Cr-Original-Commit-Position: refs/heads/master@{#295783}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0380637c0085884d209fbbcaf0f0b0871fac162a
This commit is contained in:
Brett Wilson 2014-09-19 14:24:40 -07:00
Родитель e4938e0d0b
Коммит b2d817f645
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -550,6 +550,8 @@ template("component") {
if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
if (defined(invoker.output_name)) { output_name = invoker.output_name }
if (defined(invoker.public)) { public = invoker.public }
if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
if (defined(invoker.sources)) { sources = invoker.sources }
if (defined(invoker.testonly)) { testonly = invoker.testonly }
if (defined(invoker.visibility)) { visibility = invoker.visibility }
@ -584,6 +586,8 @@ template("component") {
if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
if (defined(invoker.output_name)) { output_name = invoker.output_name }
if (defined(invoker.public)) { public = invoker.public }
if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
if (defined(invoker.sources)) { sources = invoker.sources }
if (defined(invoker.testonly)) { testonly = invoker.testonly }
if (defined(invoker.visibility)) { visibility = invoker.visibility }
@ -632,6 +636,8 @@ template("test") {
if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
if (defined(invoker.output_name)) { output_name = invoker.output_name }
if (defined(invoker.public)) { public = invoker.public }
if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
if (defined(invoker.sources)) { sources = invoker.sources }
if (defined(invoker.visibility)) { visibility = invoker.visibility }
}
@ -667,6 +673,8 @@ template("test") {
if (defined(invoker.output_extension)) { output_extension = invoker.output_extension }
if (defined(invoker.output_name)) { output_name = invoker.output_name }
if (defined(invoker.public)) { public = invoker.public }
if (defined(invoker.public_configs)) { public_configs = invoker.public_configs }
if (defined(invoker.public_deps)) { public_deps = invoker.public_deps }
if (defined(invoker.sources)) { sources = invoker.sources }
if (defined(invoker.visibility)) { visibility = invoker.visibility }
}