blob: 489ed74897ad11562d2cb4604811d486913700eb [file] [log] [blame]
Matthew Dempsky7da39482013-05-10 13:54:49 -07001# Copyright 2012 Google Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15# Description:
16# The GWT compiler and dev mode.
17
18# Google owns the copyright
19licenses(["unencumbered"])
20
21package(
22 default_visibility = [
Goktug Gokdogand6314fc2015-10-09 14:59:43 -070023 "//third_party/java/gwt:__subpackages__",
24 "//third_party/java_src/gwt:__subpackages__",
Matthew Dempsky7da39482013-05-10 13:54:49 -070025 ],
26)
27
28subinclude("//third_party/java_src/gwt:build-macros")
29
30# This target logically corresponds to gwt-dev.jar but doesn't
31# actually create it, for faster builds after a compiler change.
32java_import(
33 name = "dev",
34 jars = [
35 ":gwt-dev-deps.jar",
36 ":gwt-dev-only.jar",
37 ],
38)
39
40# Files needed by the ant tests
41filegroup(
42 name = "ant",
43 srcs = glob(
44 [
45 "build.xml",
46 "core/src/**/*",
47 "core/super/**/*",
48 "core/test/**/*",
49 ],
50 exclude = [
51 "**/*~",
52 "**/#*",
53 ],
54 ),
55)
56
57# Classes needed by the requestfactory annotation processor
58java_library(
59 name = "requestfactory-apt-deps",
60 srcs = [
61 "core/src/com/google/gwt/core/ext/typeinfo/JniConstants.java",
Matthew Dempsky7da39482013-05-10 13:54:49 -070062 "core/src/com/google/gwt/dev/util/Name.java",
63 "core/src/com/google/gwt/dev/util/StringKey.java",
64 ],
65)
66
67# Dependencies of gwt-servlet.jar. (Included in server run-time classpaths.)
68java_library(
69 name = "servlet-deps",
70 srcs = glob(
71 [
72 "core/src/com/google/gwt/**/shared/**/*.java",
Matthew Dempsky7da39482013-05-10 13:54:49 -070073 "core/src/com/google/gwt/dev/util/Name.java",
74 "core/src/com/google/gwt/dev/util/StringKey.java",
75 "core/src/com/google/gwt/util/tools/Utility.java",
76 "core/src/com/google/gwt/util/tools/shared/**/*.java",
77 ],
78 exclude = [
79 "**/junit/**",
80 "**/super/**",
Matthew Dempsky7da39482013-05-10 13:54:49 -070081 ],
82 ),
Roberto Lublinerman05592162016-06-15 16:35:59 -070083 compatible_with = ["//buildenv/target:appengine"],
Matthew Dempsky7da39482013-05-10 13:54:49 -070084 deps = [
85 # GWTBridge & UnsafeNativeLong
86 ":compiler.standalone.super",
87 ],
88)
89
90# Builds gwt-dev-deps.jar, which contains third-party deps for gwt-dev.jar.
91# (This is a separate jar for better build caching.)
92AugmentedJar(
93 name = "gwt-dev-deps",
94 srcs = [],
95 added_jars = [
Brian Slesinsky3114e452014-04-23 10:56:53 -070096 "//third_party/java_src/gwt/legacy:libdev-bare.jar",
Matthew Dempsky7da39482013-05-10 13:54:49 -070097 "//third_party/java_src/gwt/legacy:dev-resources.jar",
98 "//third_party/java_src/gwt/svn/tools:dev_jars",
99 "//third_party/java_src/gwt/svn/tools:legacy_dev_jars",
100 ],
Roberto Lublinerman05592162016-06-15 16:35:59 -0700101 compatible_with = ["//buildenv/target:appengine"],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700102 constraints = [],
103 dojarjar = 1,
104 wrap_javalibrary = 0,
105)
106
107# Builds gwt-dev-only.jar, which contains the GWT compiler and tools.
108# Relies on gwt-dev-deps.jar being in the classpath.
109AugmentedJar(
110 name = "gwt-dev-only",
111 srcs = [],
112 added_jars = [
Brian Slesinsky3114e452014-04-23 10:56:53 -0700113 ":libgwt-dev-bare.jar",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700114 ":gwt-dev-resources.jar",
115 ":libcompiler.standalone.jar",
116 ":libcompiler.standalone.super.jar",
117 ":super-resources.jar",
118 ],
Roberto Lublinerman05592162016-06-15 16:35:59 -0700119 compatible_with = ["//buildenv/target:appengine"],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700120 constraints = [],
121 dojarjar = 1,
122 resources = ["//tools/gwt:gwt_google_defaults"],
123 wrap_javalibrary = 0,
124)
125
Brian Slesinsky3114e452014-04-23 10:56:53 -0700126# The gwt-dev classes for GWT internal use only.
127# They must be jarjar-ed and dependencies stripped before exposing to google3.
Matthew Dempsky7da39482013-05-10 13:54:49 -0700128java_library(
Brian Slesinsky3114e452014-04-23 10:56:53 -0700129 name = "gwt-dev-bare",
Roberto Lublinermancd8e2252016-04-15 17:03:27 -0700130 srcs = glob(["core/src/**/*.java"]),
Roberto Lublinerman05592162016-06-15 16:35:59 -0700131 compatible_with = ["//buildenv/target:appengine"],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700132 deps = [
133 ":compiler.standalone.super",
Roberto Lublinermancd8e2252016-04-15 17:03:27 -0700134 "//third_party/java/gson",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700135 "//third_party/java_src/gwt/svn/tools:dev_deps",
Goktug Gokdogan6e31a152014-01-28 12:40:25 -0800136 "//third_party/java_src/gwt/svn/tools:servlet_api_3",
Daniel Kurka519e16b2015-02-18 20:23:41 +0000137 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700138)
139
140# Resource files in core/src.
141# (Includes .java files.)
142Zip(
143 name = "gwt-dev-resources.jar",
144 srcs = glob(
145 [
146 "core/src/**/*.java",
147 "core/src/**/*.html",
148 "core/src/**/*.css",
149 "core/src/**/*.js",
150 "core/src/**/*.png",
151 "core/src/**/*.gif",
152 "core/src/**/*.keystore",
153 "core/src/**/*.proto",
154 "core/src/**/*.properties",
155 "core/src/**/*.xsd",
Brian Slesinsky580a2ff2013-11-01 14:10:34 -0700156 "core/src/**/*.txt",
Roberto Lublinermanf59c19e2013-12-02 10:52:28 -0800157 "core/src/com/google/gwt/dev/js/globals/globals.html", # for testing
Matthew Dempsky7da39482013-05-10 13:54:49 -0700158 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700159 ),
Roberto Lublinerman05592162016-06-15 16:35:59 -0700160 compatible_with = ["//buildenv/target:appengine"],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700161 root = "core/src",
162)
163
164java_library(
165 name = "compiler.standalone",
166 srcs = glob(
167 [
168 "core/src/com/google/gwt/core/ext/**/*.java",
169 "core/src/com/google/gwt/core/linker/**/*.java",
170 "core/src/com/google/gwt/dev/About.java",
Roberto Lublinerman4c3de762013-10-02 15:32:37 -0700171 "core/src/com/google/gwt/dev/CompilerContext.java",
172 "core/src/com/google/gwt/dev/CompileTaskOptions.java",
173 "core/src/com/google/gwt/dev/CompileTaskOptionsImpl.java",
Roberto Lublinerman999d9a62014-12-10 13:19:04 -0800174 "core/src/com/google/gwt/dev/PropertyAndBindingInfo.java",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700175 "core/src/com/google/gwt/dev/GwtVersion.java",
John Stalcup4def7222014-07-25 11:18:08 -0700176 "core/src/com/google/gwt/dev/MinimalRebuildCache.java",
John Stalcup9da4d052014-09-02 18:41:30 -0700177 "core/src/com/google/gwt/dev/NullRebuildCache.java",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700178 "core/src/com/google/gwt/dev/Permutation.java",
Roberto Lublinerman4c3de762013-10-02 15:32:37 -0700179 "core/src/com/google/gwt/dev/PrecompileTaskOptions.java",
180 "core/src/com/google/gwt/dev/PrecompileTaskOptionsImpl.java",
181 "core/src/com/google/gwt/dev/PrecompilationResult.java",
John Stalcupb70e9f22015-01-05 11:25:19 -0800182 "core/src/com/google/gwt/dev/StringAnalyzableTypeEnvironment.java",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700183 "core/src/com/google/gwt/dev/cfg/**/*.java",
Roberto Lublinerman9fcd8482015-08-18 12:23:24 -0700184 "core/src/com/google/gwt/dev/common/**/*.java",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700185 "core/src/com/google/gwt/dev/javac/**/*.java",
186 "core/src/com/google/gwt/dev/jdt/**/*.java",
187 "core/src/com/google/gwt/dev/jjs/**/*.java",
188 "core/src/com/google/gwt/dev/js/**/*.java",
189 "core/src/com/google/gwt/dev/json/*.java",
190 "core/src/com/google/gwt/dev/resource/**/*.java",
191 "core/src/com/google/gwt/dev/util/**/*.java",
192 "core/src/com/google/gwt/dev/shell/DevModeSession.java",
193 "core/src/com/google/gwt/soyc/**/*.java",
194 "core/src/com/google/gwt/util/**/*.java",
195 "core/src/org/eclipse/jdt/**/*.java",
196 ],
197 exclude = [
198 "**/testing/**",
199 ],
200 ),
Roberto Lublinerman05592162016-06-15 16:35:59 -0700201 compatible_with = ["//buildenv/target:appengine"],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700202 deps = [
203 ":compiler.standalone.super",
Roberto Lublinermancd8e2252016-04-15 17:03:27 -0700204 "//third_party/java/gson",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700205 "//third_party/java_src/gwt/svn/tools:compiler_deps",
Daniel Kurka519e16b2015-02-18 20:23:41 +0000206 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700207)
208
209# This is a bootstrap library; it will later be stripped out of the classpath
210# chain, since the "real" versions are super-source not class files.
211# TODO(scottb): this thing may be completely obsolete.
212java_library(
213 name = "compiler.standalone.super",
214 srcs = glob(
215 ["core/super/**/*.java"],
216 exclude = [
217 "core/super/com/google/gwt/dev/jjs/intrinsic/**",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700218 ],
219 ),
Goktug Gokdogan5b327a32016-07-08 22:45:16 -0700220 compatible_with = [
221 "//buildenv/target:android",
222 "//buildenv/target:appengine",
223 ],
Matthew Dempsky9d527eb2013-08-20 11:52:58 -0700224 constraints = ["android"],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700225)
226
227# Resource files in core/super (including Java source)
228Zip(
229 name = "super-resources.jar",
230 srcs = glob(
231 [
232 "core/super/**/*.java",
233 "core/super/**/*.xml",
234 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700235 ),
Roberto Lublinerman05592162016-06-15 16:35:59 -0700236 compatible_with = ["//buildenv/target:appengine"],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700237 root = "core/super",
238)
239
240# A minimal library for annotations not likely to otherwise need gwt-user.jar
241# (so i18n annotations are out, they'd need i18n classes and interfaces, but
242# @GwtScriptOnly is in). The test is that this target is for POJO Java work
243# that happens to want a bit of annotations to hint GWT what to do.
244#
245# CAUTION: Most internal Google code ends up depending on this, via
246# //j/c/g/common/collect:collect-gwt. You really don't want it to be big!
247java_library(
Goktug Gokdogand6314fc2015-10-09 14:59:43 -0700248 name = "gwt-dev-interop-annotations",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700249 srcs = [
250 "core/super/com/google/gwt/core/client/GwtScriptOnly.java",
251 "core/super/com/google/gwt/core/client/UnsafeNativeLong.java",
252 ],
Roberto Lublinerman15a925d2016-01-11 15:46:51 -0800253 compatible_with = ["//buildenv/target:android"],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700254 constraints = [
255 "android",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700256 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700257)
258
Goktug Gokdogand6314fc2015-10-09 14:59:43 -0700259# A minimal library for a subset of the internal annotations for the
260# GWT compiler.
261java_library(
262 name = "gwt-dev-internal-annotations",
263 srcs = [
264 "core/super/javaemul/internal/annotations/CompilerHint.java",
265 "core/super/javaemul/internal/annotations/DoNotInline.java",
266 ],
Roberto Lublinerman15a925d2016-01-11 15:46:51 -0800267 compatible_with = ["//buildenv/target:android"],
Goktug Gokdogand6314fc2015-10-09 14:59:43 -0700268 constraints = [
269 "android",
270 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700271)
272
273# All test code in dev.
274# TODO: split up.
275AugmentedJar(
276 name = "dev-test-code",
Brian Slesinsky3114e452014-04-23 10:56:53 -0700277 testonly = 1,
278 srcs = [],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700279 added_jars = [
Brian Slesinsky3114e452014-04-23 10:56:53 -0700280 ":libdev-test-code-bare.jar",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700281 # for soycTest
282 "//third_party/java_src/gwt/svn/trunk/samples:hello-src.jar",
283 ],
284 added_roots = [
285 "core/test",
286 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700287 constraints = [],
288 dojarjar = 1,
289 export_deps = [
290 ":dev", # for the post-jarjar names
Brian Slesinsky3114e452014-04-23 10:56:53 -0700291 "//third_party/java/junit",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700292 ],
Brian Slesinsky3114e452014-04-23 10:56:53 -0700293)
294
295# The gwt-dev tests for GWT internal use only.
296# They must be jarjar-ed and dependencies stripped before exposing to google3.
297# TODO(skybrian): we should have a separate jar for test infrastructure and
298# and remove dependencies on this library in gwt-user and google3.
299java_library(
300 name = "dev-test-code-bare",
301 testonly = 1,
302 srcs = glob([
303 "core/test/**/*.java",
304 ]),
Goktug Gokdogan5b327a32016-07-08 22:45:16 -0700305 javacopts = [
306 "-Xep:SelfComparison:OFF",
307 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700308 deps = [
Brian Slesinsky3114e452014-04-23 10:56:53 -0700309 ":compiler.standalone.super",
310 ":gwt-dev-bare",
Roberto Lublinermancd8e2252016-04-15 17:03:27 -0700311 "//third_party/java/gson",
Brian Slesinsky3114e452014-04-23 10:56:53 -0700312 "//third_party/java/junit",
313 "//third_party/java_src/gwt/svn/tools:dev_deps",
Daniel Kurka519e16b2015-02-18 20:23:41 +0000314 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700315)
316
317# The "dev" directory is tested by loose tests. Some of them fail because of
318# classpath expectations that are invalid in Google's distributed build
319# environment.
320GWT_DEV_TESTS = glob(
321 [
322 "core/test/**/*Test.java",
323 ],
324 # TODO(fabbott): These fail due to classpath differences,
325 # because the distributed build's classpath is jar'ed not loose
326 exclude = [
327 "core/test/**/ClassPathEntryTest.java",
328 "core/test/**/ResourceOracleImplTest.java",
Matthew Dempsky7da39482013-05-10 13:54:49 -0700329 ],
330)
331
Brian Slesinsky13724c62014-09-03 17:15:50 -0700332test_suite(
333 name = "alltests",
334 tests = [
335 ":tests",
Roberto Lublinerman8aa3abc2014-09-25 14:30:38 -0700336 "//third_party/java_src/gwt/svn/trunk/dev/codeserver:tests",
337 ],
Brian Slesinsky13724c62014-09-03 17:15:50 -0700338)
339
Matthew Dempsky7da39482013-05-10 13:54:49 -0700340GwtTestSuites(
341 name = "tests",
342 jvm_flags = ["-ea"],
Goktug Gokdogan4269ce12015-03-10 17:07:26 -0700343 sharding = {"dev.CompilerTest": 12},
Matthew Dempsky7da39482013-05-10 13:54:49 -0700344 tests = GWT_DEV_TESTS,
Goktug Gokdogan26deda22015-10-19 15:48:30 -0700345 deps = [":dev-test-code"],
Matthew Dempsky7da39482013-05-10 13:54:49 -0700346)