blob: 1e346d4da23e1b9be55c4c333b698fb5a28b7331 [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# Sample apps for GWT. (Mirrored to svn.)
17
18# Google owns the copyright
19licenses(["unencumbered"])
20
21package(
22 default_visibility = ["//third_party/java_src/gwt:__pkg__"],
23)
24
Roberto Lublinerman37ff62f2016-09-27 13:39:25 -070025load("//third_party/java_src/gwt:build-macros.bzl", "AugmentedJar", "Zip")
Matthew Dempsky7da39482013-05-10 13:54:49 -070026
27package_group(
28 name = "showcase_friends",
29 packages = ["//javatests/com/google/gwt/tourguide/..."],
30)
31
32# Files in this directory for running ant
33# Note: ant_test.sh replaces this build.xml file with its own stub.
34filegroup(
35 name = "ant",
Roberto Lublinermanf01ebee2014-03-15 09:20:11 -070036 srcs = glob([
37 "build.xml",
38 "**/*.java",
39 ]),
Matthew Dempsky7da39482013-05-10 13:54:49 -070040)
41
42Zip(
43 name = "hello-src.jar",
44 srcs = glob([
45 "hello/src/**/*.java",
46 "hello/src/**/*.xml",
47 ]),
48 root = "hello/src",
49 visibility = ["//third_party/java_src/gwt/svn/trunk/dev:__pkg__"],
50)
51
52# Allow friends to import the showcase app as a GWT module
53gwt_module(
54 name = "showcase_module",
55 extra_inherits = ["com.google.gwt.sample.showcase.Showcase"],
56 rename_to = "showcase",
57 visibility = [":showcase_friends"],
58 deps = [":showcase_lib"],
59)
60
61gwt_application(
62 name = "showcase_app",
63 module_target = ":showcase_module",
64)
65
66java_library(
67 name = "showcase_lib",
Roberto Lublinerman37ff62f2016-09-27 13:39:25 -070068 srcs = [":showcase.srcjar"],
69 constraints = [
70 "gwt",
71 "public",
72 ],
73 deps = [
74 "//third_party/java_src/gwt",
75 "//third_party/java_src/gwt:gwt-dev",
76 ],
Matthew Dempsky7da39482013-05-10 13:54:49 -070077)
78
79AugmentedJar(
80 name = "showcase",
81 srcs = glob(
82 ["showcase/src/**/*.java"],
83 exclude_directories = 1,
84 ),
85 added_roots = ["showcase/src"],
86 deps = [
87 "//third_party/java_src/gwt",
88 "//third_party/java_src/gwt:gwt-dev",
89 ],
90)
91
Roberto Lublinerman37ff62f2016-09-27 13:39:25 -070092# we need to rename the jar file to end with .srcjar
93# for it to be valid input into a java_library rule
94genrule(
95 name = "rename_jar",
96 srcs = [":showcase.jar"],
97 outs = ["showcase.srcjar"],
98 cmd = "cp $(location :showcase.jar) $@",
99)
100
Matthew Dempsky7da39482013-05-10 13:54:49 -0700101# Provides the contents of the showcase war directory as a handy zip file
102# (Doesn't include appengine-web.xml so you can replace it.)
103Zip(
104 name = "showcase-wardir.zip",
105 srcs = glob(
106 ["showcase/war/**"],
107 exclude = glob(["showcase/war/**/*~"]) + [
108 "showcase/war/WEB-INF/appengine-web.xml",
109 ],
110 ),
111 root = "showcase/war",
112 visibility = [":showcase_friends"],
113)