Commit 24bc6198 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Relativize paths in build files

BUG=871574

Change-Id: I8eca9b8fabf1e90b0e9c054dd5283be21508bae4
Reviewed-on: https://chromium-review.googlesource.com/1164536Reviewed-by: default avatarJohann Koenig <johannkoenig@google.com>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582764}
parent 81db97a9
...@@ -269,9 +269,9 @@ grit("generate_webui_resources") { ...@@ -269,9 +269,9 @@ grit("generate_webui_resources") {
# webui/resources has way too many resources. The whitelist is trim this down # webui/resources has way too many resources. The whitelist is trim this down
# to a reasonable size # to a reasonable size
whitelist = rebase_path("ui/grit_resources_whitelist.txt") whitelist = rebase_path("ui/grit_resources_whitelist.txt", root_build_dir)
inputs = [ inputs = [
whitelist, "//android_webview/ui/grit_resources_whitelist.txt",
] ]
grit_flags = [ grit_flags = [
"-w", "-w",
...@@ -292,9 +292,9 @@ grit("generate_components_resources") { ...@@ -292,9 +292,9 @@ grit("generate_components_resources") {
source_is_generated = true source_is_generated = true
# See :generate_webui_resources for an explanation of the whitelist # See :generate_webui_resources for an explanation of the whitelist
whitelist = rebase_path("ui/grit_resources_whitelist.txt") whitelist = rebase_path("ui/grit_resources_whitelist.txt", root_build_dir)
inputs = [ inputs = [
whitelist, "//android_webview/ui/grit_resources_whitelist.txt",
] ]
grit_flags = [ grit_flags = [
"-w", "-w",
...@@ -317,9 +317,9 @@ grit("generate_components_strings") { ...@@ -317,9 +317,9 @@ grit("generate_components_strings") {
# will never display most of them, so we try to limit the included # will never display most of them, so we try to limit the included
# strings. This whitelist trims about 50% more than the compile-based # strings. This whitelist trims about 50% more than the compile-based
# whitelist generated by :system_webview_pak_whitelist. # whitelist generated by :system_webview_pak_whitelist.
whitelist = rebase_path("ui/grit_strings_whitelist.txt") whitelist = rebase_path("ui/grit_strings_whitelist.txt", root_build_dir)
inputs = [ inputs = [
whitelist, "//android_webview/ui/grit_strings_whitelist.txt",
] ]
grit_flags = [ grit_flags = [
"-w", "-w",
......
...@@ -39,14 +39,14 @@ template("generate_resource_rewriter") { ...@@ -39,14 +39,14 @@ template("generate_resource_rewriter") {
deps = invoker.deps + [ ":${_build_config_target_name}" ] deps = invoker.deps + [ ":${_build_config_target_name}" ]
script = "//build/android/gyp/generate_resource_rewriter.py" script = "//build/android/gyp/generate_resource_rewriter.py"
_rebased_build_config = rebase_path(_build_config) _rebased_build_config = rebase_path(_build_config, root_build_dir)
args = [ args = [
"--package-name", "--package-name",
invoker.package_name, invoker.package_name,
"--dep-packages", "--dep-packages",
"@FileArg($_rebased_build_config:resources:extra_package_names)", "@FileArg($_rebased_build_config:resources:extra_package_names)",
"--srcjar", "--srcjar",
rebase_path(_srcjar), rebase_path(_srcjar, root_build_dir),
] ]
outputs = [ outputs = [
_srcjar, _srcjar,
......
...@@ -189,12 +189,14 @@ config("executable_config") { ...@@ -189,12 +189,14 @@ config("executable_config") {
config("hide_all_but_jni_onload") { config("hide_all_but_jni_onload") {
ldflags = [ "-Wl,--version-script=" + rebase_path( ldflags = [ "-Wl,--version-script=" + rebase_path(
"//build/android/android_only_explicit_jni_exports.lst") ] "//build/android/android_only_explicit_jni_exports.lst",
root_build_dir) ]
} }
config("hide_all_but_jni") { config("hide_all_but_jni") {
ldflags = [ "-Wl,--version-script=" + ldflags = [ "-Wl,--version-script=" +
rebase_path("//build/android/android_only_jni_exports.lst") ] rebase_path("//build/android/android_only_jni_exports.lst",
root_build_dir) ]
} }
config("lld_pack_relocations") { config("lld_pack_relocations") {
......
...@@ -1822,7 +1822,8 @@ if (enable_java_templates) { ...@@ -1822,7 +1822,8 @@ if (enable_java_templates) {
inputs = [ inputs = [
invoker.build_config, invoker.build_config,
] ]
_rebased_build_config = rebase_path(invoker.build_config) _rebased_build_config =
rebase_path(invoker.build_config, root_build_dir)
defines += [ defines += [
"COMPRESSED_LOCALE_LIST=" + "COMPRESSED_LOCALE_LIST=" +
"@FileArg($_rebased_build_config:compressed_locales_java_list)", "@FileArg($_rebased_build_config:compressed_locales_java_list)",
......
...@@ -2396,12 +2396,12 @@ action("device_policy_remover_generate") { ...@@ -2396,12 +2396,12 @@ action("device_policy_remover_generate") {
args = [ args = [
# generated file name # generated file name
rebase_path(device_policy_remover_path), rebase_path(device_policy_remover_path, root_build_dir),
# directories for PATH variable to compile generated file # directories for PATH variable to compile generated file
rebase_path(descriptor_pool_path), rebase_path(descriptor_pool_path, root_build_dir),
rebase_path(symbol_database_path), rebase_path(symbol_database_path, root_build_dir),
rebase_path(chrome_device_policy_pb2_path), rebase_path(chrome_device_policy_pb2_path, root_build_dir),
] ]
public_deps = [ public_deps = [
......
...@@ -46,7 +46,7 @@ grit("test_resources") { ...@@ -46,7 +46,7 @@ grit("test_resources") {
grit_flags = [ grit_flags = [
"-E", "-E",
"generated_resources_dir=" + rebase_path(target_gen_dir), "generated_resources_dir=" + rebase_path(target_gen_dir, root_build_dir),
] ]
deps = [ deps = [
......
...@@ -236,7 +236,7 @@ template("cast_test_group") { ...@@ -236,7 +236,7 @@ template("cast_test_group") {
args = [ args = [
"-o", "-o",
rebase_path("$_output_prefix.tests"), rebase_path("$_output_prefix.tests", root_build_dir),
"create_list", "create_list",
] ]
...@@ -262,7 +262,7 @@ template("cast_test_group") { ...@@ -262,7 +262,7 @@ template("cast_test_group") {
args = [ args = [
"-o", "-o",
rebase_path("$_output_prefix.filters"), rebase_path("$_output_prefix.filters", root_build_dir),
"create_list", "create_list",
] ]
...@@ -395,9 +395,9 @@ template("cast_test_group_list") { ...@@ -395,9 +395,9 @@ template("cast_test_group_list") {
args = [ args = [
"-o", "-o",
rebase_path(invoker.build_list_path), rebase_path(invoker.build_list_path, root_build_dir),
"-t", "-t",
rebase_path(_shared_dir), rebase_path(_shared_dir, root_build_dir),
"pack_build", "pack_build",
] ]
...@@ -422,11 +422,11 @@ template("cast_test_group_list") { ...@@ -422,11 +422,11 @@ template("cast_test_group_list") {
args = [ args = [
"-o", "-o",
rebase_path(invoker.run_list_path), rebase_path(invoker.run_list_path, root_build_dir),
"-d", "-d",
rebase_path(invoker.runtime_deps_path), rebase_path(invoker.runtime_deps_path, root_build_dir),
"-t", "-t",
rebase_path(_shared_dir), rebase_path(_shared_dir, root_build_dir),
"pack_run", "pack_run",
] ]
......
...@@ -11,7 +11,7 @@ action("gencode") { ...@@ -11,7 +11,7 @@ action("gencode") {
"$target_gen_dir/input_methods.h", "$target_gen_dir/input_methods.h",
] ]
args = [ args = [
rebase_path("//chromeos/ime/input_methods.txt"), rebase_path("//chromeos/ime/input_methods.txt", root_build_dir),
rebase_path("$target_gen_dir/input_methods.h"), rebase_path("$target_gen_dir/input_methods.h", root_build_dir),
] ]
} }
...@@ -47,9 +47,7 @@ compiled_action("generate_top_domains_trie") { ...@@ -47,9 +47,7 @@ compiled_action("generate_top_domains_trie") {
"$target_gen_dir/alexa_domains-trie-inc.cc", "$target_gen_dir/alexa_domains-trie-inc.cc",
] ]
args = args =
# Make sure the inputs are system-absolute, as base::File cannot open rebase_path(inputs, root_build_dir) + rebase_path(outputs, root_build_dir)
# files with ".." components.
rebase_path(inputs, "", "/") + rebase_path(outputs, root_build_dir)
} }
# TODO: Combine this and the previous one into a compiled_action_foreach target. # TODO: Combine this and the previous one into a compiled_action_foreach target.
...@@ -65,7 +63,5 @@ compiled_action("generate_top_domains_test_trie") { ...@@ -65,7 +63,5 @@ compiled_action("generate_top_domains_test_trie") {
"$target_gen_dir/test_domains-trie-inc.cc", "$target_gen_dir/test_domains-trie-inc.cc",
] ]
args = args =
# Make sure the inputs are system-absolute, as base::File cannot open rebase_path(inputs, root_build_dir) + rebase_path(outputs, root_build_dir)
# files with ".." components.
rebase_path(inputs, "", "/") + rebase_path(outputs, root_build_dir)
} }
...@@ -71,7 +71,8 @@ int main(int argc, char* argv[]) { ...@@ -71,7 +71,8 @@ int main(int argc, char* argv[]) {
return 1; return 1;
} }
base::FilePath input_path = base::FilePath::FromUTF8Unsafe(argv[1]); base::FilePath input_path =
base::MakeAbsoluteFilePath(base::FilePath::FromUTF8Unsafe(argv[1]));
if (!base::PathExists(input_path)) { if (!base::PathExists(input_path)) {
LOG(ERROR) << "Input path doesn't exist: " << input_path; LOG(ERROR) << "Input path doesn't exist: " << input_path;
return 1; return 1;
...@@ -146,4 +147,4 @@ int main(int argc, char* argv[]) { ...@@ -146,4 +147,4 @@ int main(int argc, char* argv[]) {
} }
return 0; return 0;
} }
\ No newline at end of file
...@@ -38,7 +38,7 @@ template("remoting_credits") { ...@@ -38,7 +38,7 @@ template("remoting_credits") {
"--gn-target", "--gn-target",
invoker.gn_target, invoker.gn_target,
"--gn-out-dir", "--gn-out-dir",
rebase_path(root_build_dir), ".",
] ]
} }
......
...@@ -71,7 +71,8 @@ action("remoting_me2me_host_archive") { ...@@ -71,7 +71,8 @@ action("remoting_me2me_host_archive") {
] ]
_generated_files = rebase_path(inputs, root_build_dir) _generated_files = rebase_path(inputs, root_build_dir)
_generated_files += [ rebase_path("//remoting/resources/chromoting.ico") ] _generated_files +=
[ rebase_path("//remoting/resources/chromoting.ico", root_build_dir) ]
# _generated_dst_files must contain the same files in the same order as # _generated_dst_files must contain the same files in the same order as
# _generated_files, otherwise the Windows MSI will not be built correctly. # _generated_files, otherwise the Windows MSI will not be built correctly.
...@@ -95,10 +96,12 @@ action("remoting_me2me_host_archive") { ...@@ -95,10 +96,12 @@ action("remoting_me2me_host_archive") {
rebase_path("$root_gen_dir/remoting_installation", root_build_dir), rebase_path("$root_gen_dir/remoting_installation", root_build_dir),
rebase_path(_output, root_build_dir), rebase_path(_output, root_build_dir),
"--source-file-roots", "--source-file-roots",
rebase_path("//remoting/host/installer/win"), rebase_path("//remoting/host/installer/win", root_build_dir),
"--source-files", "--source-files",
rebase_path("//remoting/host/installer/win/chromoting.wxs"), rebase_path("//remoting/host/installer/win/chromoting.wxs",
rebase_path("//remoting/host/installer/win/parameters.json"), root_build_dir),
rebase_path("//remoting/host/installer/win/parameters.json",
root_build_dir),
# Input files # Input files
"--generated-files", "--generated-files",
...@@ -133,7 +136,7 @@ if (is_chrome_branded && !is_component_build && target_cpu == "x86") { ...@@ -133,7 +136,7 @@ if (is_chrome_branded && !is_component_build && target_cpu == "x86") {
] ]
args = [ args = [
"--wix_path", "--wix_path",
rebase_path("//third_party/wix"), rebase_path("//third_party/wix", root_build_dir),
"--intermediate_dir", "--intermediate_dir",
rebase_path("$root_gen_dir/remoting_installation", root_build_dir), rebase_path("$root_gen_dir/remoting_installation", root_build_dir),
"--target_arch", "--target_arch",
......
...@@ -178,6 +178,10 @@ template("fuzzer_test") { ...@@ -178,6 +178,10 @@ template("fuzzer_test") {
configs -= invoker.suppressed_configs configs -= invoker.suppressed_configs
} }
if (defined(invoker.generated_sources)) {
sources += invoker.generated_sources
}
if (is_mac) { if (is_mac) {
sources += [ "//testing/libfuzzer/libfuzzer_exports.h" ] sources += [ "//testing/libfuzzer/libfuzzer_exports.h" ]
} }
......
...@@ -459,8 +459,8 @@ proto_library("javascript_parser_proto") { ...@@ -459,8 +459,8 @@ proto_library("javascript_parser_proto") {
} }
fuzzer_test("javascript_parser_proto_fuzzer") { fuzzer_test("javascript_parser_proto_fuzzer") {
generated_sources = [ "$target_gen_dir/javascript_parser_proto_to_string.cc" ]
sources = [ sources = [
"$target_gen_dir/javascript_parser_proto_to_string.cc",
"javascript_parser_proto_fuzzer.cc", "javascript_parser_proto_fuzzer.cc",
"javascript_parser_proto_to_string.h", "javascript_parser_proto_to_string.h",
] ]
......
...@@ -274,7 +274,7 @@ if (current_cpu == "arm" && arm_assembly_sources != []) { ...@@ -274,7 +274,7 @@ if (current_cpu == "arm" && arm_assembly_sources != []) {
"-i", "-i",
"{{source}}", "{{source}}",
"-o", "-o",
rebase_path(gen_file), rebase_path(gen_file, root_build_dir),
] ]
} }
......
...@@ -475,7 +475,8 @@ android_library("mockito_android_java") { ...@@ -475,7 +475,8 @@ android_library("mockito_android_java") {
include_java_resources = true include_java_resources = true
additional_jar_files = [ [ additional_jar_files = [ [
rebase_path( rebase_path(
"src/subprojects/android/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker"), "src/subprojects/android/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker",
root_build_dir),
"mockito-extensions/org.mockito.plugins.MockMaker", "mockito-extensions/org.mockito.plugins.MockMaker",
] ] ] ]
} }
...@@ -116,7 +116,8 @@ java_library("robolectric_java") { ...@@ -116,7 +116,8 @@ java_library("robolectric_java") {
] ]
additional_jar_files = [ [ additional_jar_files = [ [
rebase_path( rebase_path(
"local/robolectric/src/main/resources/robolectric-version.properties"), "local/robolectric/src/main/resources/robolectric-version.properties",
root_build_dir),
"robolectric-version.properties", "robolectric-version.properties",
] ] ] ]
...@@ -366,29 +367,34 @@ java_library("shadows_core_java") { ...@@ -366,29 +367,34 @@ java_library("shadows_core_java") {
if (host_os == "linux") { if (host_os == "linux") {
additional_jar_files = [ additional_jar_files = [
[ [
rebase_path("../sqlite4java/lib/linux-x86_64/libsqlite4java.so"), rebase_path("../sqlite4java/lib/linux-x86_64/libsqlite4java.so",
root_build_dir),
"linux-x86_64/libsqlite4java.so", "linux-x86_64/libsqlite4java.so",
], ],
[ [
rebase_path("../sqlite4java/lib/linux-x86/libsqlite4java.so"), rebase_path("../sqlite4java/lib/linux-x86/libsqlite4java.so",
root_build_dir),
"linux-x86/libsqlite4java.so", "linux-x86/libsqlite4java.so",
], ],
] ]
} }
if (host_os == "mac") { if (host_os == "mac") {
additional_jar_files = [ [ additional_jar_files = [ [
rebase_path("../sqlite4java/lib/mac-x86_64/libsqlite4java.jnilib"), rebase_path("../sqlite4java/lib/mac-x86_64/libsqlite4java.jnilib",
root_build_dir),
"mac-x86_64/libsqlite4java.jnilib", "mac-x86_64/libsqlite4java.jnilib",
] ] ] ]
} }
if (host_os == "win") { if (host_os == "win") {
additional_jar_files = [ additional_jar_files = [
[ [
rebase_path("../sqlite4java/lib/windows-x86/sqlite4java.dll"), rebase_path("../sqlite4java/lib/windows-x86/sqlite4java.dll",
root_build_dir),
"windows-x86/sqlite4java.dll", "windows-x86/sqlite4java.dll",
], ],
[ [
rebase_path("../sqlite4java/lib/windows-x86_64/sqlite4java.dll"), rebase_path("../sqlite4java/lib/windows-x86_64/sqlite4java.dll",
root_build_dir),
"windows-x86_64/sqlite4java.dll", "windows-x86_64/sqlite4java.dll",
], ],
] ]
......
...@@ -384,7 +384,7 @@ template("grit") { ...@@ -384,7 +384,7 @@ template("grit") {
} }
} }
if (_strip_resource_files) { if (_strip_resource_files) {
js_minifier_command = rebase_path(_js_minifier) js_minifier_command = rebase_path(_js_minifier, root_build_dir)
js_minifier_command = "$js_minifier_command --closure_args" js_minifier_command = "$js_minifier_command --closure_args"
foreach(closure_arg, foreach(closure_arg,
common_closure_args + minifying_closure_args + common_closure_args + minifying_closure_args +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment