diff --git a/build.gradle b/build.gradle index f4b0e3c7eb49..39842ed67209 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,11 @@ apply plugin: 'maven' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'jacoco' +apply plugin: 'signing' group = "com.google.api" -version = "0.0.0-SNAPSHOT" +archivesBaseName = "gax" +version = "0.0.0" // Dependencies // ------------ @@ -64,8 +66,17 @@ task sourcesJar(type: Jar, dependsOn: classes) { from sourceSets.main.allSource } -artifacts { - archives sourcesJar +// JavaDoc +// ------- + +task javadocJar(type: Jar) { + classifier = 'javadoc' + from javadoc +} + +javadoc.options { + encoding = 'UTF-8' + links 'https://docs.oracle.com/javase/8/docs/api/' } // Test Logging @@ -73,7 +84,7 @@ artifacts { test { testLogging { - events "passed", "skipped", "failed", "standardOut", "standardError" + events "passed", "skipped", "failed", "standardOut", "standardError" } } @@ -139,3 +150,61 @@ tasks.cleanEclipseJdt { file('.factorypath') } } + +// Publishing +// ---------- + +artifacts { + archives javadocJar, sourcesJar +} + +signing { + sign configurations.archives +} + +uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + pom.project { + name 'GAX (Google Api eXtensions)' + packaging 'jar' + artifactId 'gax' + description 'Google Api eXtensions' + url 'https://github.com/googleapis' + + scm { + url 'https://github.com/googleapis/gax-java' + connection 'scm:svn:https://github.com/googleapis/gax-java.git' + } + + licenses { + license { + name 'BSD' + url 'https://github.com/googleapis/gax-java/blob/master/LICENSE' + } + } + + developers { + developer { + id 'GoogleAPIs' + name 'GoogleAPIs' + email 'googleapis@googlegroups.com' + url 'https://github.com/googleapis' + organization 'Google, Inc.' + organizationUrl 'https://www.google.com' + } + } + } + } + } +} diff --git a/src/main/java/com/google/api/gax/bundling/BundlingThreshold.java b/src/main/java/com/google/api/gax/bundling/BundlingThreshold.java index f73dbac53140..351cd0c18f2a 100644 --- a/src/main/java/com/google/api/gax/bundling/BundlingThreshold.java +++ b/src/main/java/com/google/api/gax/bundling/BundlingThreshold.java @@ -44,7 +44,7 @@ public interface BundlingThreshold { void accumulate(E e); /** - * @returns whether the threshold has been reached. + * @return whether the threshold has been reached. */ boolean isThresholdReached(); diff --git a/src/main/java/com/google/api/gax/bundling/ThresholdBundler.java b/src/main/java/com/google/api/gax/bundling/ThresholdBundler.java index 8857805feb3a..5961ef1611c0 100644 --- a/src/main/java/com/google/api/gax/bundling/ThresholdBundler.java +++ b/src/main/java/com/google/api/gax/bundling/ThresholdBundler.java @@ -128,7 +128,7 @@ public void flush() { * Remove all currently contained elements, regardless of whether they have triggered any * thresholds. All elements are placed into 'bundle'. * - * @returns the number of items added to 'bundle'. + * @return the number of items added to 'bundle'. */ public int drainTo(Collection bundle) { final Lock lock = this.lock; diff --git a/src/main/java/com/google/api/gax/core/RetryParams.java b/src/main/java/com/google/api/gax/core/RetryParams.java index 336b9f8db760..3090e81bae00 100644 --- a/src/main/java/com/google/api/gax/core/RetryParams.java +++ b/src/main/java/com/google/api/gax/core/RetryParams.java @@ -35,7 +35,7 @@ /** * {@code RetryParams} encapsulates a retry strategy used by - * {@link com.google.api.gax.grpc.ApiCallable#retrying(RetryParams)}. + * {@link com.google.api.gax.grpc.ApiCallable#retrying(RetryParams, ScheduledExecutorService)}. */ @AutoValue public abstract class RetryParams { diff --git a/src/main/java/com/google/api/gax/grpc/ApiCallable.java b/src/main/java/com/google/api/gax/grpc/ApiCallable.java index c9e1d40e711c..8366383d81ed 100644 --- a/src/main/java/com/google/api/gax/grpc/ApiCallable.java +++ b/src/main/java/com/google/api/gax/grpc/ApiCallable.java @@ -136,10 +136,10 @@ public void onSuccess(ResponseT result) { } /** - * Same as {@link #asyncCall(RequestT, StreamObserver)}, with null {@link io.grpc.Channel} and + * Same as {@link #asyncCall(CallContext, StreamObserver)}, with null {@link io.grpc.Channel} and * default {@link io.grpc.CallOptions}. * - * @param context {@link com.google.api.gax.grpc.CallContext} to make the call with + * @param request request * @param observer Observer to interact with the result */ public void asyncCall(RequestT request, StreamObserver observer) { diff --git a/src/main/java/com/google/api/gax/protobuf/PathTemplate.java b/src/main/java/com/google/api/gax/protobuf/PathTemplate.java index 2b9c7b8a8c2a..e276cd43c4fb 100644 --- a/src/main/java/com/google/api/gax/protobuf/PathTemplate.java +++ b/src/main/java/com/google/api/gax/protobuf/PathTemplate.java @@ -55,7 +55,7 @@ /** * Represents a path template. * - *

Templates use the syntax of the API platform; see the protobuf of {@link HttpRule} for + *

Templates use the syntax of the API platform; see the protobuf of HttpRule for * details. A template consists of a sequence of literals, wildcards, and variable bindings, * where each binding can have a sub-path. A string representation can be parsed into an * instance of {@link PathTemplate}, which can then be used to perform matching and instantiation. @@ -70,7 +70,7 @@ *

  *   PathTemplate template = PathTemplate.create("v1/shelves/{shelf}/books/{book}");
  *   assert template.match("v2/shelves"} == false
- *   Map<String, String> values = template.match("v1/shelves/s1/books/b1");
+ *   Map<String, String> values = template.match("v1/shelves/s1/books/b1");
  *   assert values.equals(ImmutableMap.of("shelf", s1", "book", "b1");
  *   assert template.instantiate(values).equals("v1/shelves/s1/books/b1");
  * 
@@ -89,7 +89,7 @@ *
  *   PathTemplate template = PathTemplate.create("shelves/*/books/*"};
  *   assert template.match("shelves/books/b1") == null;
- *   Map<String, String> values = template.match("v1/shelves/s1/books/b1");
+ *   Map<String, String> values = template.match("v1/shelves/s1/books/b1");
  *   assert values.equals(ImmutableMap.of("$0", s1", "$1", "b1");
  * 
* @@ -210,7 +210,7 @@ String separator() { /** * Creates a path template from a string. The string must satisfy the syntax - * of path templates of the API platform; see {@link HttpRule}'s proto source. + * of path templates of the API platform; see HttpRule's proto source. * * @throws ValidationException if there are errors while parsing the template. */