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

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: Resolved rebase conflicts 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("//testing/test.gni") 5 import("//testing/test.gni")
6 import("features.gni")
6 7
7 if (is_android) { 8 if (is_android) {
8 import("//build/config/android/rules.gni") 9 import("//build/config/android/rules.gni")
9 } 10 }
10 11
11 # Shared sources between url and url_lib_use_icu_alternatives_on_android. 12 component("url") {
12 url_shared_sources = [ 13 sources = [
13 "gurl.cc", 14 "gurl.cc",
14 "gurl.h", 15 "gurl.h",
15 "origin.cc", 16 "origin.cc",
16 "origin.h", 17 "origin.h",
17 "scheme_host_port.cc", 18 "scheme_host_port.cc",
18 "scheme_host_port.h", 19 "scheme_host_port.h",
19 "third_party/mozilla/url_parse.cc", 20 "third_party/mozilla/url_parse.cc",
20 "third_party/mozilla/url_parse.h", 21 "third_party/mozilla/url_parse.h",
21 "url_canon.h", 22 "url_canon.h",
22 "url_canon_etc.cc", 23 "url_canon_etc.cc",
23 "url_canon_filesystemurl.cc", 24 "url_canon_filesystemurl.cc",
24 "url_canon_fileurl.cc", 25 "url_canon_fileurl.cc",
25 "url_canon_host.cc", 26 "url_canon_host.cc",
26 "url_canon_internal.cc", 27 "url_canon_internal.cc",
27 "url_canon_internal.h", 28 "url_canon_internal.h",
28 "url_canon_internal_file.h", 29 "url_canon_internal_file.h",
29 "url_canon_ip.cc", 30 "url_canon_ip.cc",
30 "url_canon_ip.h", 31 "url_canon_ip.h",
31 "url_canon_mailtourl.cc", 32 "url_canon_mailtourl.cc",
32 "url_canon_path.cc", 33 "url_canon_path.cc",
33 "url_canon_pathurl.cc", 34 "url_canon_pathurl.cc",
34 "url_canon_query.cc", 35 "url_canon_query.cc",
35 "url_canon_relative.cc", 36 "url_canon_relative.cc",
36 "url_canon_stdstring.cc", 37 "url_canon_stdstring.cc",
37 "url_canon_stdstring.h", 38 "url_canon_stdstring.h",
38 "url_canon_stdurl.cc", 39 "url_canon_stdurl.cc",
39 "url_constants.cc", 40 "url_constants.cc",
40 "url_constants.h", 41 "url_constants.h",
41 "url_export.h", 42 "url_export.h",
42 "url_file.h", 43 "url_file.h",
43 "url_parse_file.cc", 44 "url_parse_file.cc",
44 "url_parse_internal.h", 45 "url_parse_internal.h",
45 "url_util.cc", 46 "url_util.cc",
46 "url_util.h", 47 "url_util.h",
47 ] 48 ]
48 49
49 component("url") {
50 sources = url_shared_sources + [
51 "url_canon_icu.cc",
52 "url_canon_icu.h",
53 ]
54
55 if (is_win) {
56 # Don't conflict with Windows' "url.dll".
57 output_name = "url_lib"
58 }
59 defines = [ "URL_IMPLEMENTATION" ] 50 defines = [ "URL_IMPLEMENTATION" ]
60 51
61 configs += [ 52 configs += [
62 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 53 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
63 "//build/config/compiler:no_size_t_to_int_warning", 54 "//build/config/compiler:no_size_t_to_int_warning",
64 ] 55 ]
65 56
66 deps = [ 57 deps = [
67 "//base", 58 "//base",
68 "//base/third_party/dynamic_annotations", 59 "//base/third_party/dynamic_annotations",
69 "//third_party/icu",
70 "//third_party/icu:icudata",
71 ] 60 ]
61
62 if (is_win) {
63 # Don't conflict with Windows' "url.dll".
64 output_name = "url_lib"
65 }
66
67 # ICU support.
68 if (is_android && use_platform_icu_alternatives) {
mef 2016/04/01 20:42:50 maybe split this into 3 separate ifs? if (!use_pl
kapishnikov 2016/04/04 20:17:27 It is possible that none of the conditions will ma
69 sources += [
70 "android/url_jni_registrar.cc",
71 "android/url_jni_registrar.h",
72 "url_canon_icu_alternatives_android.cc",
73 "url_canon_icu_alternatives_android.h",
74 ]
75 defines += [ "USE_PLATFORM_ICU_ALTERNATIVES=1" ]
76 deps += [
77 ":url_java",
78 ":url_jni_headers",
79 "//base",
80 "//base/third_party/dynamic_annotations",
81 ]
82 } else if (is_ios && use_platform_icu_alternatives) {
83 sources += [ "url_canon_icu_alternatives_ios.mm" ]
84 defines += [ "USE_PLATFORM_ICU_ALTERNATIVES=1" ]
85 } else { # use third-party ICU implementation.
86 sources += [
87 "url_canon_icu.cc",
88 "url_canon_icu.h",
89 ]
90 deps += [
91 "//third_party/icu",
92 "//third_party/icu:icudata",
93 ]
94 }
72 } 95 }
73 96
74 if (is_android) { 97 if (is_android) {
75 android_library("url_java") { 98 android_library("url_java") {
76 java_files = [ "android/java/src/org/chromium/url/IDNStringUtil.java" ] 99 java_files = [ "android/java/src/org/chromium/url/IDNStringUtil.java" ]
77 deps = [ 100 deps = [
78 "//base:base_java", 101 "//base:base_java",
79 ] 102 ]
80 } 103 }
81 104
82 generate_jni("url_jni_headers") { 105 generate_jni("url_jni_headers") {
83 sources = [ 106 sources = [
84 "android/java/src/org/chromium/url/IDNStringUtil.java", 107 "android/java/src/org/chromium/url/IDNStringUtil.java",
85 ] 108 ]
86 jni_package = "url" 109 jni_package = "url"
87 } 110 }
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 } 111 }
115 112
116 test("url_unittests") { 113 test("url_unittests") {
117 sources = [ 114 sources = [
118 "gurl_unittest.cc", 115 "gurl_unittest.cc",
119 "origin_unittest.cc", 116 "origin_unittest.cc",
120 "run_all_unittests.cc", 117 "run_all_unittests.cc",
121 "scheme_host_port_unittest.cc", 118 "scheme_host_port_unittest.cc",
122 "url_canon_icu_unittest.cc", 119 "url_canon_icu_unittest.cc",
123 "url_canon_unittest.cc", 120 "url_canon_unittest.cc",
124 "url_parse_unittest.cc", 121 "url_parse_unittest.cc",
125 "url_test_utils.h", 122 "url_test_utils.h",
126 "url_util_unittest.cc", 123 "url_util_unittest.cc",
127 ] 124 ]
128 125
129 if (!is_ios) { 126 if (!is_ios) {
130 sources += [ "mojo/url_gurl_struct_traits_unittest.cc" ] 127 sources += [ "mojo/url_gurl_struct_traits_unittest.cc" ]
131 } 128 }
132 129
130 # Unit tests that are not supported by the current ICU alternatives on Android .
131 if (is_android && use_platform_icu_alternatives) {
132 sources -= [
133 "origin_unittest.cc",
134 "scheme_host_port_unittest.cc",
135 "url_canon_icu_unittest.cc",
136 "url_canon_unittest.cc",
137 ]
138 }
139
140 # Unit tests that are not supported by the current ICU alternatives on iOS.
141 if (is_ios && use_platform_icu_alternatives) {
142 sources -= [
143 "origin_unittest.cc",
144 "scheme_host_port_unittest.cc",
145 "url_canon_icu_unittest.cc",
146 "url_canon_unittest.cc",
147 ]
148 }
149
133 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 150 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
134 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] 151 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
135 152
136 deps = [ 153 deps = [
137 ":url", 154 ":url",
138 "//base", 155 "//base",
139 "//base/test:test_support", 156 "//base/test:test_support",
140 "//testing/gtest", 157 "//testing/gtest",
141 "//third_party/icu:icuuc", 158 "//third_party/icu:icuuc",
142 ] 159 ]
143 160
144 if (!is_ios) { 161 if (!is_ios) {
145 deps += [ 162 deps += [
146 "//mojo/edk/system", 163 "//mojo/edk/system",
147 "//mojo/edk/test:test_support", 164 "//mojo/edk/test:test_support",
148 "//url/mojo:test_url_mojom_gurl", 165 "//url/mojo:test_url_mojom_gurl",
149 ] 166 ]
150 } 167 }
151 } 168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698