2022-03-15 00:33:52 +00:00
|
|
|
load("//lib/tests/write_source_files:write_source_file_test.bzl", "write_source_file_test")
|
|
|
|
load("//lib/tests:default_output_gen.bzl", "default_output_gen")
|
2022-01-28 02:15:28 +00:00
|
|
|
load("//lib:write_source_files.bzl", "write_source_files")
|
2022-03-02 20:58:36 +00:00
|
|
|
load("//lib:copy_to_directory.bzl", "copy_to_directory")
|
2022-03-15 00:33:52 +00:00
|
|
|
load("//lib:directory_path.bzl", "directory_path")
|
|
|
|
load("//lib:default_info_files.bzl", "default_info_files")
|
2022-01-28 02:15:28 +00:00
|
|
|
|
|
|
|
genrule(
|
|
|
|
name = "a-desired",
|
|
|
|
outs = ["a-desired.js"],
|
2022-03-15 00:33:52 +00:00
|
|
|
cmd = "echo 'console.log(\"a*\");' > $@",
|
2022-01-28 02:15:28 +00:00
|
|
|
)
|
|
|
|
|
2022-03-15 00:33:52 +00:00
|
|
|
default_output_gen(
|
|
|
|
name = "b_c-desired",
|
|
|
|
out_contents = [
|
|
|
|
"""console.log(\"b*\");
|
|
|
|
""",
|
|
|
|
"not used!",
|
|
|
|
],
|
|
|
|
out_files = [
|
|
|
|
"b-desired.js",
|
|
|
|
"c-desired.js",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
default_info_files(
|
2022-01-28 02:15:28 +00:00
|
|
|
name = "b-desired",
|
2022-03-15 00:33:52 +00:00
|
|
|
paths = ["%s/b-desired.js" % package_name()],
|
|
|
|
target = ":b_c-desired",
|
2022-01-28 02:15:28 +00:00
|
|
|
)
|
|
|
|
|
2022-03-02 20:58:36 +00:00
|
|
|
genrule(
|
2022-03-15 00:33:52 +00:00
|
|
|
name = "e-contained",
|
|
|
|
outs = ["e-contained.js"],
|
|
|
|
cmd = "echo 'console.log(\"e*\");' > $@",
|
2022-03-02 20:58:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
copy_to_directory(
|
|
|
|
name = "e_dir-desired",
|
2022-03-15 00:33:52 +00:00
|
|
|
srcs = [":e-contained"],
|
2022-03-02 20:58:36 +00:00
|
|
|
)
|
|
|
|
|
2022-03-15 00:33:52 +00:00
|
|
|
genrule(
|
|
|
|
name = "f-contained",
|
|
|
|
outs = ["f-contained.js"],
|
|
|
|
cmd = "echo 'console.log(\"f*\");' > $@",
|
|
|
|
)
|
|
|
|
|
|
|
|
copy_to_directory(
|
|
|
|
name = "e_f_dir-desired",
|
|
|
|
srcs = [
|
|
|
|
":e-contained",
|
|
|
|
":f-contained",
|
2022-01-28 02:15:28 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2022-03-15 00:33:52 +00:00
|
|
|
directory_path(
|
|
|
|
name = "f-desired",
|
|
|
|
directory = ":e_f_dir-desired",
|
|
|
|
path = "f-contained.js",
|
|
|
|
)
|
|
|
|
|
|
|
|
write_source_file_test(
|
|
|
|
name = "write_to_source_files_a_test",
|
|
|
|
in_file = ":a-desired",
|
|
|
|
out_file = "a.js",
|
|
|
|
)
|
|
|
|
|
|
|
|
write_source_file_test(
|
|
|
|
name = "write_to_source_files_b_test",
|
|
|
|
in_file = ":b-desired",
|
|
|
|
out_file = "b.js",
|
|
|
|
)
|
|
|
|
|
|
|
|
write_source_file_test(
|
|
|
|
name = "write_to_source_files_f_test",
|
|
|
|
in_file = ":f-desired",
|
|
|
|
out_file = "f.js",
|
|
|
|
)
|
|
|
|
|
2022-01-28 02:15:28 +00:00
|
|
|
write_source_files(
|
|
|
|
name = "macro_smoke_test",
|
2022-03-02 20:58:36 +00:00
|
|
|
additional_update_targets = [
|
|
|
|
"//lib/tests/write_source_files/subdir:macro_smoke_test",
|
|
|
|
],
|
2022-01-28 02:15:28 +00:00
|
|
|
files = {
|
|
|
|
"a2.js": ":a-desired",
|
|
|
|
"b2.js": ":b-desired",
|
2022-03-15 00:33:52 +00:00
|
|
|
"e2_dir": ":e_dir-desired",
|
|
|
|
"f2.js": ":f-desired",
|
2022-01-28 02:15:28 +00:00
|
|
|
},
|
2022-02-28 23:42:20 +00:00
|
|
|
)
|