diff --git a/gerrit-common/BUCK b/gerrit-common/BUCK index df6237c658..ac2045eef3 100644 --- a/gerrit-common/BUCK +++ b/gerrit-common/BUCK @@ -6,16 +6,6 @@ ANNOTATIONS = [ SRC + 'common/auth/SignInRequired.java', ] -EXCLUDES = [ - SRC + 'common/SiteLibraryLoaderUtil.java', - SRC + 'common/PluginData.java', - SRC + 'common/FileUtil.java', - SRC + 'common/IoUtil.java', - SRC + 'common/RawInputUtil.java', - SRC + 'common/TimeUtil.java', - SRC + 'common/data/SubscribeSection.java', -] - java_library( name = 'annotations', srcs = ANNOTATIONS, @@ -24,13 +14,18 @@ java_library( gwt_module( name = 'client', - srcs = glob([SRC + 'common/**/*.java'], excludes = EXCLUDES), + srcs = glob([SRC + 'common/**/*.java']), gwt_xml = SRC + 'Common.gwt.xml', exported_deps = [ - '//gerrit-extension-api:client', + '//gerrit-extension-api:api', '//gerrit-prettify:client', + '//lib:guava', '//lib:gwtorm_client', + '//lib/joda:joda-time', + '//lib/log:api', + '@jgit//org.eclipse.jgit:jgit', ], + provided_deps = ['//lib:servlet-api-3_1'], visibility = ['PUBLIC'], ) @@ -43,9 +38,9 @@ java_library( '//gerrit-patch-jgit:server', '//gerrit-prettify:server', '//gerrit-reviewdb:server', + '//lib:guava', '//lib:gwtjsonrpc', '//lib:gwtorm', - '//lib:guava', '//lib/joda:joda-time', '//lib/log:api', '@jgit//org.eclipse.jgit:jgit', diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/FileUtil.java b/gerrit-common/src/main/java/com/google/gerrit/common/FileUtil.java index ed28ec09b8..83dc4d85bb 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/FileUtil.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/FileUtil.java @@ -14,6 +14,8 @@ package com.google.gerrit.common; +import com.google.common.annotations.GwtIncompatible; + import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.storage.file.FileBasedConfig; import org.eclipse.jgit.util.IO; @@ -25,6 +27,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.Arrays; +@GwtIncompatible("Unemulated classes in java.io, java.nio and JGit") public class FileUtil { public static boolean modified(FileBasedConfig cfg) throws IOException { byte[] curVers; diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/IoUtil.java b/gerrit-common/src/main/java/com/google/gerrit/common/IoUtil.java index 9bc2ea52af..3422a78dcb 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/IoUtil.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/IoUtil.java @@ -14,6 +14,7 @@ package com.google.gerrit.common; +import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.Sets; import java.io.IOException; @@ -29,6 +30,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.Set; +@GwtIncompatible("Unemulated methods in Class and OutputStream") public final class IoUtil { public static void copyWithThread(final InputStream src, final OutputStream dst) { diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/PluginData.java b/gerrit-common/src/main/java/com/google/gerrit/common/PluginData.java index 27dc6398da..4645158cc2 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/PluginData.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/PluginData.java @@ -14,9 +14,12 @@ package com.google.gerrit.common; +import com.google.common.annotations.GwtIncompatible; + import java.nio.file.Path; import java.util.Objects; +@GwtIncompatible("Unemulated java.nio.file.Path") public class PluginData { public final String name; public final String version; diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/RawInputUtil.java b/gerrit-common/src/main/java/com/google/gerrit/common/RawInputUtil.java index dfd84537e2..edcd11183d 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/RawInputUtil.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/RawInputUtil.java @@ -16,6 +16,7 @@ package com.google.gerrit.common; import static java.nio.charset.StandardCharsets.UTF_8; +import com.google.common.annotations.GwtIncompatible; import com.google.common.base.Preconditions; import com.google.gerrit.extensions.restapi.RawInput; @@ -25,6 +26,7 @@ import java.io.InputStream; import javax.servlet.http.HttpServletRequest; +@GwtIncompatible("Unemulated classes in java.io and javax.servlet") public class RawInputUtil { public static RawInput create(String content) { return create(content.getBytes(UTF_8)); @@ -52,7 +54,7 @@ public class RawInputUtil { } public static RawInput create(final byte[] bytes) { - return create (bytes, "application/octet-stream"); + return create(bytes, "application/octet-stream"); } public static RawInput create(final HttpServletRequest req) { diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/SiteLibraryLoaderUtil.java b/gerrit-common/src/main/java/com/google/gerrit/common/SiteLibraryLoaderUtil.java index 2511a5183c..bf87d7ba24 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/SiteLibraryLoaderUtil.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/SiteLibraryLoaderUtil.java @@ -16,6 +16,7 @@ package com.google.gerrit.common; import static com.google.gerrit.common.FileUtil.lastModified; +import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.ComparisonChain; import com.google.common.collect.ImmutableList; import com.google.common.collect.Ordering; @@ -30,6 +31,7 @@ import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.util.List; +@GwtIncompatible("Unemulated classes in java.nio and Guava") public final class SiteLibraryLoaderUtil { private static final Logger log = LoggerFactory.getLogger(SiteLibraryLoaderUtil.class); diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/TimeUtil.java b/gerrit-common/src/main/java/com/google/gerrit/common/TimeUtil.java index 4274b5aa0b..ec91a81ab5 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/TimeUtil.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/TimeUtil.java @@ -14,11 +14,14 @@ package com.google.gerrit.common; +import com.google.common.annotations.GwtIncompatible; + import org.joda.time.DateTimeUtils; import java.sql.Timestamp; /** Static utility methods for dealing with dates and times. */ +@GwtIncompatible("Unemulated org.joda.time.DateTimeUtils") public class TimeUtil { public static long nowMs() { return DateTimeUtils.currentTimeMillis(); diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/data/SubscribeSection.java b/gerrit-common/src/main/java/com/google/gerrit/common/data/SubscribeSection.java index 7ec1edaba8..b05f335025 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/data/SubscribeSection.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/data/SubscribeSection.java @@ -14,6 +14,7 @@ package com.google.gerrit.common.data; +import com.google.common.annotations.GwtIncompatible; import com.google.gerrit.reviewdb.client.Branch; import com.google.gerrit.reviewdb.client.Project; @@ -25,6 +26,7 @@ import java.util.Collections; import java.util.List; /** Portion of a {@link Project} describing superproject subscription rules. */ +@GwtIncompatible("Unemulated org.eclipse.jgit.transport.RefSpec") public class SubscribeSection { private final List refSpecs; diff --git a/tools/eclipse/gerrit_gwt_debug.launch b/tools/eclipse/gerrit_gwt_debug.launch index c3c58ffcf1..b2ab320750 100644 --- a/tools/eclipse/gerrit_gwt_debug.launch +++ b/tools/eclipse/gerrit_gwt_debug.launch @@ -16,7 +16,7 @@ - +