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

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: Code cleaning 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
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("features") {
12 url_shared_sources = [ 14 header = "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 ":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 += [
102 "//third_party/icu",
103 "//third_party/icu:icudata",
brettw 2016/04/08 21:40:06 You should be able to delete this icudata referenc
kapishnikov 2016/04/11 19:58:48 Done.
104 ]
105 }
72 } 106 }
73 107
74 if (is_android) { 108 if (is_android) {
75 android_library("url_java") { 109 android_library("url_java") {
76 java_files = [ "android/java/src/org/chromium/url/IDNStringUtil.java" ] 110 java_files = [ "android/java/src/org/chromium/url/IDNStringUtil.java" ]
77 deps = [ 111 deps = [
78 "//base:base_java", 112 "//base:base_java",
79 ] 113 ]
80 } 114 }
81 115
82 generate_jni("url_jni_headers") { 116 generate_jni("url_jni_headers") {
83 sources = [ 117 sources = [
84 "android/java/src/org/chromium/url/IDNStringUtil.java", 118 "android/java/src/org/chromium/url/IDNStringUtil.java",
85 ] 119 ]
86 jni_package = "url" 120 jni_package = "url"
87 } 121 }
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 } 122 }
115 123
116 test("url_unittests") { 124 test("url_unittests") {
117 sources = [ 125 sources = [
118 "gurl_unittest.cc", 126 "gurl_unittest.cc",
119 "origin_unittest.cc", 127 "origin_unittest.cc",
120 "run_all_unittests.cc", 128 "run_all_unittests.cc",
121 "scheme_host_port_unittest.cc", 129 "scheme_host_port_unittest.cc",
122 "url_canon_icu_unittest.cc", 130 "url_canon_icu_unittest.cc",
123 "url_canon_unittest.cc", 131 "url_canon_unittest.cc",
124 "url_parse_unittest.cc", 132 "url_parse_unittest.cc",
125 "url_test_utils.h", 133 "url_test_utils.h",
126 "url_util_unittest.cc", 134 "url_util_unittest.cc",
127 ] 135 ]
128 136
137 deps = [
138 ":url",
139 "//base",
140 "//base/test:test_support",
141 "//testing/gtest",
142 ]
143
129 if (!is_ios) { 144 if (!is_ios) {
130 sources += [ "mojo/url_gurl_struct_traits_unittest.cc" ] 145 sources += [ "mojo/url_gurl_struct_traits_unittest.cc" ]
131 } 146 }
132 147
148 if (use_platform_icu_alternatives) {
149 # Unit tests that are not supported by the current ICU alternatives on Andro id.
150 if (is_android) {
151 sources -= [
152 "url_canon_icu_unittest.cc",
153 "url_canon_unittest.cc",
154 ]
155 deps += [ ":url_java" ]
156 }
157
158 # Unit tests that are not supported by the current ICU alternatives on iOS.
159 if (is_ios) {
160 sources -= [
161 "origin_unittest.cc",
162 "scheme_host_port_unittest.cc",
163 "url_canon_icu_unittest.cc",
164 "url_canon_unittest.cc",
165 ]
166 }
167 } else { # !use_platform_icu_alternatives
168 deps += [ "//third_party/icu:icuuc" ]
169 }
170
133 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 171 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
134 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] 172 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
135 173
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) { 174 if (!is_ios) {
145 deps += [ 175 deps += [
146 "//mojo/edk/system", 176 "//mojo/edk/system",
147 "//mojo/edk/test:test_support", 177 "//mojo/edk/test:test_support",
148 "//url/mojo:test_url_mojom_gurl", 178 "//url/mojo:test_url_mojom_gurl",
149 ] 179 ]
150 } 180 }
151 } 181 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698