Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
build: google format plugin upgrade (#868)
Browse files Browse the repository at this point in the history
* Google-java-format-plugin 0.8

* Applied google-java-format with new version

* VerifyGoogleJavaFormat only for Java8

* onlyIf

* isJava8Compatible

* Added comment

* empty commit for Kokoro build

* Jacoco 0.8.2

* Giving up Jacoco upgrade

* What went wrong:
A problem occurred configuring root project 'gax-java'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve gradle.plugin.com.dorongold.plugins:task-tree:1.3.1.
     Required by:
         project :
      > Could not resolve gradle.plugin.com.dorongold.plugins:task-tree:1.3.1.
         > Could not get resource 'https://plugins.gradle.org/m2/gradle/plugin/com/dorongold/plugins/task-tree/1.3.1/task-tree-1.3.1.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/gradle/plugin/com/dorongold/plugins/task-tree/1.3.1/task-tree-1.3.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed

https://source.cloud.google.com/results/invocations/e8c74bc9-fc2d-4047-82b8-3e2d5b9cdc64/targets/cloud-devrel%2Fclient-libraries%2Fjava%2Fgax-java%2Fpresubmit%2Fjava7/log
  • Loading branch information
suztomo committed Feb 26, 2020
1 parent 0a5b940 commit 5440bc6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
9 changes: 8 additions & 1 deletion build.gradle
Expand Up @@ -15,7 +15,7 @@ buildscript {
"io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.8.0",
"gradle.plugin.com.dorongold.plugins:task-tree:1.3.1"

classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.6"
classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.8"
}
}

Expand All @@ -40,6 +40,8 @@ googleJavaFormat {
exclude 'build/**'
exclude 'bazel*/**'
}
// google-java-format-gradle-plugin:0.8 does not work with Java 1.7.
verifyGoogleJavaFormat.onlyIf { JavaVersion.current().isJava8Compatible() }

if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') &&
!nonReleaseProjects.contains(project.name)) {
Expand All @@ -53,10 +55,15 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')
}

allprojects {
repositories {
mavenCentral() // for google-java-format's dependency
}

// Formatting tasks
// ================
apply plugin: 'com.github.sherter.google-java-format'
test.dependsOn verifyGoogleJavaFormat
verifyGoogleJavaFormat.onlyIf { JavaVersion.current().isJava8Compatible() }

task verifyLicense {
doLast {
Expand Down
Expand Up @@ -249,7 +249,8 @@ private ManagedChannel createSingleChannel() throws IOException {

// When channel pooling is enabled, force the pick_first grpclb strategy.
// This is necessary to avoid the multiplicative effect of creating channel pool with
// `poolSize` number of `ManagedChannel`s, each with a `subSetting` number of number of subchannels.
// `poolSize` number of `ManagedChannel`s, each with a `subSetting` number of number of
// subchannels.
// See the service config proto definition for more details:
// https://github.com/grpc/grpc-proto/blob/master/grpc/service_config/service_config.proto#L182
ImmutableMap<String, Object> pickFirstStrategy =
Expand Down
Expand Up @@ -551,7 +551,10 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted

public static class ListOperationsPagedResponse
extends AbstractPagedListResponse<
ListOperationsRequest, ListOperationsResponse, Operation, ListOperationsPage,
ListOperationsRequest,
ListOperationsResponse,
Operation,
ListOperationsPage,
ListOperationsFixedSizeCollection> {

public static ApiFuture<ListOperationsPagedResponse> createAsync(
Expand Down Expand Up @@ -606,7 +609,10 @@ public ApiFuture<ListOperationsPage> createPageAsync(

public static class ListOperationsFixedSizeCollection
extends AbstractFixedSizeCollection<
ListOperationsRequest, ListOperationsResponse, Operation, ListOperationsPage,
ListOperationsRequest,
ListOperationsResponse,
Operation,
ListOperationsPage,
ListOperationsFixedSizeCollection> {

private ListOperationsFixedSizeCollection(List<ListOperationsPage> pages, int collectionSize) {
Expand Down
Expand Up @@ -166,7 +166,8 @@ public Object answer(InvocationOnMock invocation) {
final ManagedChannel refreshingManagedChannel =
new RefreshingManagedChannel(channelFactory, scheduledExecutorService);

// send a bunch of request to RefreshingManagedChannel, executor needs more than 1 thread to test out concurrency
// send a bunch of request to RefreshingManagedChannel, executor needs more than 1 thread to
// test out concurrency
ExecutorService executor = Executors.newFixedThreadPool(10);

// channelCount - 1 because the last channel cannot be refreshed because the FakeChannelFactory
Expand Down
11 changes: 0 additions & 11 deletions gax/src/main/java/com/google/api/gax/tracing/OpencensusTracer.java
Expand Up @@ -90,7 +90,6 @@
* <dt>{@code connection}
* <dd>The UUID of the connection which the attempt was sent.
* </dl>
*
* <li>{@code Attempt failed, scheduling next attempt} with the following attributes:
* <dl>
* <dt>{@code attempt}
Expand All @@ -108,7 +107,6 @@
* <dt>{@code connection}
* <dd>The UUID of the connection which the attempt was sent.
* </dl>
*
* <li>{@code Attempts exhausted} with the following attributes:
* <dl>
* <dt>{@code attempt}
Expand All @@ -124,7 +122,6 @@
* <dt>{@code connection}
* <dd>The UUID of the connection which the attempt was sent.
* </dl>
*
* <li>{@code Attempt failed, error not retryable} with the following attributes:
* <dl>
* <dt>{@code attempt}
Expand All @@ -140,7 +137,6 @@
* <dt>{@code connection}
* <dd>The UUID of the connection which the attempt was sent.
* </dl>
*
* <li>{@code Attempt succeeded} with the following attributes:
* <dl>
* <dt>{@code attempt}
Expand All @@ -154,7 +150,6 @@
* <dt>{@code connection}
* <dd>The UUID of the connection which the attempt was sent.
* </dl>
*
* </ul>
*
* <p>Long running operations, which are composed of an initial RPC to start the operation and a
Expand All @@ -168,14 +163,12 @@
* <dt>{@code status}
* <dd>The status code of why the operation failed to start
* </dl>
*
* <li>{@code Polling was cancelled} with the following attributes:
* <dl>
* <dt>{@code attempt}
* <dd>Zero based sequential poll number.
* <dt>{@code attempt request count}
* </dl>
*
* <li>{@code Scheduling next poll} with the following attributes:
* <dl>
* <dt>{@code attempt}
Expand All @@ -185,29 +178,25 @@
* <dt>{@code delay}
* <dd>The number of milliseconds to wait before polling again
* </dl>
*
* <li>{@code Polling attempts exhausted} with the following attributes:
* <dl>
* <dt>{@code attempt}
* <dd>Zero based sequential poll number
* <dt>{@code status}
* <dd>OK if the poll succeeded, but the operation is still running.
* </dl>
*
* <li>{@code Polling failed} with the following attributes:
* <dl>
* <dt>{@code attempt}
* <dd>Zero based sequential poll number
* <dt>{@code status}
* <dd>OK if the poll succeeded, but the operation is still running.
* </dl>
*
* <li>{@code Polling completed} with the following attributes:
* <dl>
* <dt>{@code attempt}
* <dd>Zero based sequential poll number
* </dl>
*
* </ul>
*
* <p>The toplevel long running operation span will also contain child spans to describe the retry
Expand Down

0 comments on commit 5440bc6

Please sign in to comment.