Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: url/BUILD.gn

Issue 1839803002: Remove net & url small, iOS ICU alternatives, unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/mb/mb_config.pyl ('k') | url/android/url_jni_registrar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/buildflag_header.gni")
5 import("//testing/test.gni") 6 import("//testing/test.gni")
7 import("features.gni")
6 8
7 if (is_android) { 9 if (is_android) {
8 import("//build/config/android/rules.gni") 10 import("//build/config/android/rules.gni")
9 } 11 }
10 12
11 # Shared sources between url and url_lib_use_icu_alternatives_on_android. 13 buildflag_header("url_features") {
12 url_shared_sources = [ 14 header = "url_features.h"
13 "gurl.cc", 15 flags = [ "USE_PLATFORM_ICU_ALTERNATIVES=$use_platform_icu_alternatives" ]
14 "gurl.h", 16 }
15 "origin.cc",
16 "origin.h",
17 "scheme_host_port.cc",
18 "scheme_host_port.h",
19 "third_party/mozilla/url_parse.cc",
20 "third_party/mozilla/url_parse.h",
21 "url_canon.h",
22 "url_canon_etc.cc",
23 "url_canon_filesystemurl.cc",
24 "url_canon_fileurl.cc",
25 "url_canon_host.cc",
26 "url_canon_internal.cc",
27 "url_canon_internal.h",
28 "url_canon_internal_file.h",
29 "url_canon_ip.cc",
30 "url_canon_ip.h",
31 "url_canon_mailtourl.cc",
32 "url_canon_path.cc",
33 "url_canon_pathurl.cc",
34 "url_canon_query.cc",
35 "url_canon_relative.cc",
36 "url_canon_stdstring.cc",
37 "url_canon_stdstring.h",
38 "url_canon_stdurl.cc",
39 "url_constants.cc",
40 "url_constants.h",
41 "url_export.h",
42 "url_file.h",
43 "url_parse_file.cc",
44 "url_parse_internal.h",
45 "url_util.cc",
46 "url_util.h",
47 ]
48 17
49 component("url") { 18 component("url") {
50 sources = url_shared_sources + [ 19 sources = [
51 "url_canon_icu.cc", 20 "gurl.cc",
52 "url_canon_icu.h", 21 "gurl.h",
53 ] 22 "origin.cc",
23 "origin.h",
24 "scheme_host_port.cc",
25 "scheme_host_port.h",
26 "third_party/mozilla/url_parse.cc",
27 "third_party/mozilla/url_parse.h",
28 "url_canon.h",
29 "url_canon_etc.cc",
30 "url_canon_filesystemurl.cc",
31 "url_canon_fileurl.cc",
32 "url_canon_host.cc",
33 "url_canon_internal.cc",
34 "url_canon_internal.h",
35 "url_canon_internal_file.h",
36 "url_canon_ip.cc",
37 "url_canon_ip.h",
38 "url_canon_mailtourl.cc",
39 "url_canon_path.cc",
40 "url_canon_pathurl.cc",
41 "url_canon_query.cc",
42 "url_canon_relative.cc",
43 "url_canon_stdstring.cc",
44 "url_canon_stdstring.h",
45 "url_canon_stdurl.cc",
46 "url_constants.cc",
47 "url_constants.h",
48 "url_export.h",
49 "url_file.h",
50 "url_parse_file.cc",
51 "url_parse_internal.h",
52 "url_util.cc",
53 "url_util.h",
54 ]
54 55
55 if (is_win) {
56 # Don't conflict with Windows' "url.dll".
57 output_name = "url_lib"
58 }
59 defines = [ "URL_IMPLEMENTATION" ] 56 defines = [ "URL_IMPLEMENTATION" ]
60 57
61 configs += [ 58 configs += [
62 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 59 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
63 "//build/config/compiler:no_size_t_to_int_warning", 60 "//build/config/compiler:no_size_t_to_int_warning",
64 ] 61 ]
65 62
66 deps = [ 63 deps = [
67 "//base", 64 "//base",
68 "//base/third_party/dynamic_annotations", 65 "//base/third_party/dynamic_annotations",
69 "//third_party/icu",
70 "//third_party/icu:icudata",
71 ] 66 ]
67
68 if (is_win) {
69 # Don't conflict with Windows' "url.dll".
70 output_name = "url_lib"
71 }
72
73 # ICU support.
74 if (use_platform_icu_alternatives) {
75 if (is_android) {
76 sources += [
77 "android/url_jni_registrar.cc",
78 "android/url_jni_registrar.h",
79 "url_canon_icu_alternatives_android.cc",
80 "url_canon_icu_alternatives_android.h",
81 ]
82 deps += [
83 ":url_features",
84 ":url_java",
85 ":url_jni_headers",
86 "//base",
87 "//base/third_party/dynamic_annotations",
88 ]
89 } else if (is_ios) {
90 sources += [ "url_canon_icu_alternatives_ios.mm" ]
91 } else {
92 assert(false,
93 "ICU alternative is not implemented for platform: " + target_os)
94 }
95 } else {
96 # Use ICU.
97 sources += [
98 "url_canon_icu.cc",
99 "url_canon_icu.h",
100 ]
101 deps += [ "//third_party/icu" ]
102 }
72 } 103 }
73 104
74 if (is_android) { 105 if (is_android) {
75 android_library("url_java") { 106 android_library("url_java") {
76 java_files = [ "android/java/src/org/chromium/url/IDNStringUtil.java" ] 107 java_files = [ "android/java/src/org/chromium/url/IDNStringUtil.java" ]
77 deps = [ 108 deps = [
78 "//base:base_java", 109 "//base:base_java",
79 ] 110 ]
80 } 111 }
81 112
82 generate_jni("url_jni_headers") { 113 generate_jni("url_jni_headers") {
83 sources = [ 114 sources = [
84 "android/java/src/org/chromium/url/IDNStringUtil.java", 115 "android/java/src/org/chromium/url/IDNStringUtil.java",
85 ] 116 ]
86 jni_package = "url" 117 jni_package = "url"
87 } 118 }
88
89 component("url_lib_use_icu_alternatives_on_android") {
90 sources = url_shared_sources + [
91 "android/url_jni_registrar.cc",
92 "android/url_jni_registrar.h",
93 "url_canon_icu_alternatives_android.cc",
94 "url_canon_icu_alternatives_android.h",
95 ]
96
97 defines = [
98 "URL_IMPLEMENTATION",
99 "USE_ICU_ALTERNATIVES_ON_ANDROID=1",
100 ]
101
102 configs += [
103 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
104 "//build/config/compiler:no_size_t_to_int_warning",
105 ]
106
107 deps = [
108 ":url_java",
109 ":url_jni_headers",
110 "//base",
111 "//base/third_party/dynamic_annotations",
112 ]
113 }
114 } 119 }
115 120
116 test("url_unittests") { 121 test("url_unittests") {
117 sources = [ 122 sources = [
118 "gurl_unittest.cc", 123 "gurl_unittest.cc",
119 "origin_unittest.cc", 124 "origin_unittest.cc",
120 "run_all_unittests.cc", 125 "run_all_unittests.cc",
121 "scheme_host_port_unittest.cc", 126 "scheme_host_port_unittest.cc",
122 "url_canon_icu_unittest.cc", 127 "url_canon_icu_unittest.cc",
123 "url_canon_unittest.cc", 128 "url_canon_unittest.cc",
124 "url_parse_unittest.cc", 129 "url_parse_unittest.cc",
125 "url_test_utils.h", 130 "url_test_utils.h",
126 "url_util_unittest.cc", 131 "url_util_unittest.cc",
127 ] 132 ]
128 133
134 deps = [
135 ":url",
136 "//base",
137 "//base/test:test_support",
138 "//testing/gtest",
139 ]
140
129 if (!is_ios) { 141 if (!is_ios) {
130 sources += [ "mojo/url_gurl_struct_traits_unittest.cc" ] 142 sources += [ "mojo/url_gurl_struct_traits_unittest.cc" ]
131 } 143 }
132 144
145 if (use_platform_icu_alternatives) {
146 # Unit tests that are not supported by the current ICU alternatives on Andro id.
147 if (is_android) {
148 sources -= [
149 "url_canon_icu_unittest.cc",
150 "url_canon_unittest.cc",
151 ]
152 deps += [ ":url_java" ]
153 }
154
155 # Unit tests that are not supported by the current ICU alternatives on iOS.
156 if (is_ios) {
157 sources -= [
158 "origin_unittest.cc",
159 "scheme_host_port_unittest.cc",
160 "url_canon_icu_unittest.cc",
161 "url_canon_unittest.cc",
162 ]
163 }
164 } else { # !use_platform_icu_alternatives
165 deps += [ "//third_party/icu:icuuc" ]
166 }
167
133 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 168 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
134 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] 169 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
135 170
136 deps = [
137 ":url",
138 "//base",
139 "//base/test:test_support",
140 "//testing/gtest",
141 "//third_party/icu:icuuc",
142 ]
143
144 if (!is_ios) { 171 if (!is_ios) {
145 deps += [ 172 deps += [
146 "//mojo/edk/system", 173 "//mojo/edk/system",
147 "//mojo/edk/test:test_support", 174 "//mojo/edk/test:test_support",
148 "//url/mojo:test_url_mojom_gurl", 175 "//url/mojo:test_url_mojom_gurl",
149 ] 176 ]
150 } 177 }
151 } 178 }
OLDNEW
« no previous file with comments | « tools/mb/mb_config.pyl ('k') | url/android/url_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698