BUILD.gn 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Copyright 2014 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//third_party/protobuf/proto_library.gni")
  5. static_library("crx_file") {
  6. sources = [
  7. "crx_file.h",
  8. "crx_verifier.cc",
  9. "crx_verifier.h",
  10. "id_util.cc",
  11. "id_util.h",
  12. ]
  13. deps = [
  14. "//base",
  15. "//crypto",
  16. ]
  17. public_deps = [ ":crx3_proto" ]
  18. }
  19. static_library("crx_creator") {
  20. sources = [
  21. "crx_creator.cc",
  22. "crx_creator.h",
  23. ]
  24. deps = [
  25. ":crx_file",
  26. "//base",
  27. "//crypto",
  28. ]
  29. public_deps = [ ":crx3_proto" ]
  30. }
  31. bundle_data("unit_tests_bundle_data") {
  32. visibility = [ ":unit_tests" ]
  33. testonly = true
  34. sources = [
  35. "//components/test/data/crx_file/sample.zip",
  36. "//components/test/data/crx_file/unsigned.crx3",
  37. "//components/test/data/crx_file/valid.crx2",
  38. "//components/test/data/crx_file/valid_no_publisher.crx3",
  39. "//components/test/data/crx_file/valid_publisher.crx3",
  40. "//components/test/data/crx_file/valid_test_publisher.crx3",
  41. ]
  42. outputs = [ "{{bundle_resources_dir}}/" +
  43. "{{source_root_relative_dir}}/{{source_file_part}}" ]
  44. }
  45. source_set("unit_tests") {
  46. testonly = true
  47. sources = [
  48. "crx_creator_unittest.cc",
  49. "crx_verifier_unittest.cc",
  50. "id_util_unittest.cc",
  51. ]
  52. deps = [
  53. ":crx_creator",
  54. ":crx_file",
  55. ":unit_tests_bundle_data",
  56. "//base",
  57. "//crypto",
  58. "//testing/gtest",
  59. ]
  60. }
  61. proto_library("crx3_proto") {
  62. sources = [ "crx3.proto" ]
  63. }
  64. if (host_toolchain == current_toolchain) {
  65. executable("crx3_build_action") {
  66. testonly = true
  67. sources = [ "crx_build_action_main.cc" ]
  68. deps = [
  69. ":crx_creator",
  70. "//base",
  71. "//crypto",
  72. ]
  73. }
  74. }