Sync back build files

Change-Id: I8440c4b8109b2a74bda2dd381d929d8b5468fe81
diff --git a/dev/BUILD b/dev/BUILD
index fb67927..7355767 100644
--- a/dev/BUILD
+++ b/dev/BUILD
@@ -20,10 +20,8 @@
 
 package(
     default_visibility = [
-        "//third_party/java_src/gwt:__pkg__",
-        "//third_party/java_src/gwt/legacy:__pkg__",
-        "//third_party/java_src/gwt/svn/trunk/dev/codeserver:__pkg__",
-        "//third_party/java_src/gwt/svn/trunk/user:__pkg__",
+        "//third_party/java/gwt:__subpackages__",
+        "//third_party/java_src/gwt:__subpackages__",
     ],
 )
 
@@ -244,24 +242,27 @@
 # CAUTION: Most internal Google code ends up depending on this, via
 #  //j/c/g/common/collect:collect-gwt.  You really don't want it to be big!
 java_library(
-    name = "interop-annotations",
+    name = "gwt-dev-interop-annotations",
     srcs = [
         "core/super/com/google/gwt/core/client/GwtScriptOnly.java",
         "core/super/com/google/gwt/core/client/UnsafeNativeLong.java",
     ],
     constraints = [
         "android",
-        "gwt",
-        "public",
     ],
-    gwtxml = ":interop-annotations-gwtxml",
 )
 
-# (This is a genrule so that it won't be mirrored to svn and git.)
-genrule(
-    name = "interop-annotations-gwtxml",
-    outs = ["Gwt-dev-interop-annotations.gwt.xml"],
-    cmd = "$(ECHO) '<module><source path=\"client\" /></module>' > $(@)",
+# A minimal library for a subset of the internal annotations for the
+# GWT compiler.
+java_library(
+    name = "gwt-dev-internal-annotations",
+    srcs = [
+        "core/super/javaemul/internal/annotations/CompilerHint.java",
+        "core/super/javaemul/internal/annotations/DoNotInline.java",
+    ],
+    constraints = [
+        "android",
+    ],
 )
 
 # All test code in dev.
diff --git a/user/BUILD b/user/BUILD
index d3ac5eb..f4fe504 100644
--- a/user/BUILD
+++ b/user/BUILD
@@ -138,18 +138,27 @@
            "$(location java/com/google/web/bindery/autobean/AutoBean.gwt.xml)"),
 )
 
+java_import(
+    name = "autobean_import",
+    constraints = [
+        "gwt",
+        "public",
+    ],
+    jars = [":autobean-classes-src.jar"],
+    deps = [
+        "//third_party/java_src/gwt:gwt-dev",
+        "//third_party/java_src/gwt:gwt-user-full",
+    ],
+)
+
 java_library(
     name = "autobean",
-    srcs = [":autobean-classes-src.jar"],
     constraints = [
         "gwt",
         "public",
     ],
     gwtxml = "java/com/google/web/bindery/autobean/AutoBean.gwt.xml",
-    deps = [
-        "//third_party/java_src/gwt:gwt-dev",
-        "//third_party/java_src/gwt:gwt-user-full",
-    ],
+    exports = [":autobean_import"],
 )
 
 # Packages just IncrementalBuilder test resource into a jar with correct java root.
@@ -209,9 +218,9 @@
 # this package are distributed in one form (through the class jars, as AugmentedJar does)
 # This prevents them appearing them on classpath as both sources and classes, which confuses javac
 # For example see b/3033925
-java_library(
+java_import(
     name = "gwt-servlet-internal",
-    srcs = [":libgwt-servlet-impl.jar"],
+    jars = [":libgwt-servlet-impl.jar"],
 )
 
 java_library(
@@ -405,17 +414,7 @@
     ],
     constraints = [
         "android",
-        "gwt",
-        "public",
     ],
-    gwtxml = "Gwt-jsinterop-annotations.gwt.xml",
-)
-
-# (This is a genrule so that it won't be mirrored to svn and git.)
-genrule(
-    name = "jsinterop-annotations-gwtxml",
-    outs = ["Gwt-jsinterop-annotations.gwt.xml"],
-    cmd = "$(ECHO) '<module><source path=\"client\" /></module>' > $(@)",
 )
 
 # Creates gwt-testing.jar, which contains GWTTestCase and its infrastructure.
@@ -469,11 +468,6 @@
     ],
     constraints = [
         "android",
-        "gwt",
-        "public",
-    ],
-    deps = [
-        "//third_party/java/jsr305_annotations",
     ],
 )