| # Copyright 2022 The Cobalt Authors. All Rights Reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//cobalt/media/testing/data/sha1_files.gni") |
| |
| action("cobalt_media_download_test_data") { |
| install_content = true |
| |
| script = "//tools/download_from_gcs.py" |
| |
| sha_sources = [] |
| foreach(sha1_file, sha1_files) { |
| sha_sources += [ string_join("/", |
| [ |
| "data", |
| sha1_file, |
| ]) ] |
| } |
| |
| sha_outputs = [] |
| subdir = "cobalt/media/testing" |
| outdir = "$sb_static_contents_output_data_dir/test/$subdir" |
| foreach(sha_source, sha_sources) { |
| sha_outputs += [ string_join("/", |
| [ |
| outdir, |
| string_replace(sha_source, ".sha1", ""), |
| ]) ] |
| } |
| |
| sources = sha_sources |
| outputs = sha_outputs |
| |
| sha1_dir = rebase_path("data", root_build_dir) |
| |
| args = [ |
| "--bucket", |
| "cobalt-static-storage", |
| "--sha1", |
| sha1_dir, |
| "--output", |
| rebase_path("$outdir/data", root_build_dir), |
| ] |
| } |