xref: /aosp_15_r20/external/angle/build/private_code_test/BUILD.gn (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker# Copyright 2023 The Chromium Authors
2*8975f5c5SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
3*8975f5c5SAndroid Build Coastguard Worker# found in the LICENSE file.
4*8975f5c5SAndroid Build Coastguard Worker
5*8975f5c5SAndroid Build Coastguard Workerimport("//build/config/python.gni")
6*8975f5c5SAndroid Build Coastguard Workerimport("//build_overrides/build.gni")
7*8975f5c5SAndroid Build Coastguard Workerimport("private_code_test.gni")
8*8975f5c5SAndroid Build Coastguard Worker
9*8975f5c5SAndroid Build Coastguard Workeraction("private_paths") {
10*8975f5c5SAndroid Build Coastguard Worker  script = "list_gclient_deps.py"
11*8975f5c5SAndroid Build Coastguard Worker  outputs = [ "$target_gen_dir/private_paths.txt" ]
12*8975f5c5SAndroid Build Coastguard Worker  args = [
13*8975f5c5SAndroid Build Coastguard Worker    "--source-filter",
14*8975f5c5SAndroid Build Coastguard Worker    "chrome-internal",
15*8975f5c5SAndroid Build Coastguard Worker    "--output",
16*8975f5c5SAndroid Build Coastguard Worker    rebase_path(outputs[0], root_build_dir),
17*8975f5c5SAndroid Build Coastguard Worker  ]
18*8975f5c5SAndroid Build Coastguard Worker  inputs = [ "//../.gclient_entries" ]
19*8975f5c5SAndroid Build Coastguard Worker}
20*8975f5c5SAndroid Build Coastguard Worker
21*8975f5c5SAndroid Build Coastguard Worker# --collect-inputs-only requires a source_set dep or !is_component_build.
22*8975f5c5SAndroid Build Coastguard Workerif (!is_component_build) {
23*8975f5c5SAndroid Build Coastguard Worker  action("private_code_test_gclient_deps") {
24*8975f5c5SAndroid Build Coastguard Worker    script = "list_gclient_deps.py"
25*8975f5c5SAndroid Build Coastguard Worker    outputs = [ "$target_gen_dir/test_private_paths.txt" ]
26*8975f5c5SAndroid Build Coastguard Worker    args = [
27*8975f5c5SAndroid Build Coastguard Worker      "--source-filter",
28*8975f5c5SAndroid Build Coastguard Worker      "v8.git",
29*8975f5c5SAndroid Build Coastguard Worker      "--output",
30*8975f5c5SAndroid Build Coastguard Worker      rebase_path(outputs[0], root_build_dir),
31*8975f5c5SAndroid Build Coastguard Worker    ]
32*8975f5c5SAndroid Build Coastguard Worker    inputs = [ "//../.gclient_entries" ]
33*8975f5c5SAndroid Build Coastguard Worker  }
34*8975f5c5SAndroid Build Coastguard Worker
35*8975f5c5SAndroid Build Coastguard Worker  shared_library("private_code_test_inputs") {
36*8975f5c5SAndroid Build Coastguard Worker    deps = [ "//v8" ]
37*8975f5c5SAndroid Build Coastguard Worker    ldflags = [ "--collect-inputs-only" ]
38*8975f5c5SAndroid Build Coastguard Worker  }
39*8975f5c5SAndroid Build Coastguard Worker
40*8975f5c5SAndroid Build Coastguard Worker  # Test that ensures the checker fails when it is supposed to.
41*8975f5c5SAndroid Build Coastguard Worker  private_code_test("private_code_failure_test") {
42*8975f5c5SAndroid Build Coastguard Worker    linker_inputs_dep = ":private_code_test_inputs"
43*8975f5c5SAndroid Build Coastguard Worker    private_paths_dep = ":private_code_test_gclient_deps"
44*8975f5c5SAndroid Build Coastguard Worker    private_paths_file = "$target_gen_dir/test_private_paths.txt"
45*8975f5c5SAndroid Build Coastguard Worker    expect_failure = true
46*8975f5c5SAndroid Build Coastguard Worker  }
47*8975f5c5SAndroid Build Coastguard Worker}
48