Matthew Dempsky | 7da3948 | 2013-05-10 13:54:49 -0700 | [diff] [blame] | 1 | # 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 | # Elemental bindings for GWT # released under various licenses, derived from Dart project |
| 17 | licenses(["notice"]) # BSD (with Chrome/WebKit IDL files under LGPL) |
| 18 | |
| 19 | package(default_visibility = [ |
| 20 | "//visibility:public", |
| 21 | ]) |
| 22 | |
| 23 | ELEMENTAL_EXTRA_XML = """ |
| 24 | <inherits name='com.google.gwt.resources.Resources' /> |
| 25 | <set-configuration-property name='user.agent.runtimeWarning' value='false' /> |
| 26 | <set-property name='user.agent' value='safari' /> |
| 27 | <source path='client' /> |
| 28 | <source path='js' /> |
| 29 | <source path='canvas'/> |
| 30 | <source path='css'/> |
| 31 | <source path='dom'/> |
| 32 | <source path='events'/> |
| 33 | <source path='html'/> |
| 34 | <source path='json'/> |
| 35 | <source path='ranges'/> |
| 36 | <source path='stylesheets'/> |
| 37 | <source path='svg'/> |
| 38 | <source path='traversal'/> |
| 39 | <source path='xpath'/> |
| 40 | <source path='xml'/> |
| 41 | <source path='util'/> |
| 42 | <super-source path='super'/> |
| 43 | """ |
| 44 | |
| 45 | genrule( |
| 46 | name = "elemental_extra_xml", |
| 47 | outs = ["ElementalExtra.gwt.xml"], |
| 48 | cmd = "echo \"" + ELEMENTAL_EXTRA_XML + "\" > $@", |
| 49 | ) |
| 50 | |
| 51 | gwt_module( |
| 52 | name = "elemental", |
| 53 | srcs = [":buildsrcjar"] + glob( |
| 54 | ["src/**/*.java"], |
| 55 | exclude = ["**/super/**"], |
| 56 | ), |
| 57 | base_inherits = ["com.google.gwt.core.Core"], |
| 58 | extra_module_contents = [":ElementalExtra.gwt.xml"], |
| 59 | resources = [ |
| 60 | "src/elemental/super/elemental/json/Json.java", |
| 61 | "src/elemental/super/elemental/json/impl/JreJsonValue.java", |
| 62 | ], |
| 63 | deps = ["//third_party/java/gwt"], |
| 64 | ) |
| 65 | |
| 66 | genrule( |
| 67 | name = "buildsrcjar", |
| 68 | srcs = glob(["idl/**/*"]), |
| 69 | outs = ["elementaldom.srcjar"], |
| 70 | cmd = " && ".join([ |
| 71 | "mkdir -p $@.tmp", |
| 72 | "export CC=$(CC)", |
| 73 | "export JAR=$(JAR)", |
| 74 | "idl/buildsrcjar $@.tmp $@", |
| 75 | ]), |
| 76 | tools = [ |
| 77 | "//third_party/crosstool", |
| 78 | "//tools/defaults:jdk", |
| 79 | "//tools/defaults:python_runtime", |
| 80 | ], |
| 81 | ) |