Skip to content

Commit

Permalink
Simplify by using a file allowlisted in release-tool
Browse files Browse the repository at this point in the history
  • Loading branch information
igorbernstein2 committed Oct 16, 2020
1 parent f6dd067 commit 22d831c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 38 deletions.
32 changes: 0 additions & 32 deletions google-cloud-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<version>1.16.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
</parent>
<properties>
<!-- The version that will be embedded in the published jar via maven-resources-plugin -->
<java-bigtable.version>1.16.1-SNAPSHOT</java-bigtable.version><!-- {x-version-update:google-cloud-bigtable:current} -->

<site.installationModule>google-cloud-bigtable</site.installationModule>

<!-- Enable the ability to skip unit tests and only run integration tests,
Expand Down Expand Up @@ -386,36 +383,7 @@
</profiles>

<build>
<resources>
<resource>
<directory>src/main/templates</directory>
<includes>
<include>**/*.java</include>
</includes>
<filtering>true</filtering>
<targetPath>${project.build.directory}/generated-sources/java</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/java/</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@

import com.google.api.core.InternalApi;

/** Utility to get the current version of the Bigtable client. */
@InternalApi("For internal use only")
public final class Version {
// The released version, populated by maven.
public static String VERSION="${java-bigtable.version}";
}
// Note: this file MUST be named GoogleUtils.java so that it can be picked up by releasetool
public class GoogleUtils {
public static final String BIGTABLE_CLIENT_VERSION =
"1.16.1-SNAPSHOT"; // {x-version-update:google-cloud-bigtable:current}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.bigtable.Version;
import com.google.cloud.bigtable.GoogleUtils;
import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation;
import com.google.cloud.bigtable.data.v2.models.KeyOffset;
import com.google.cloud.bigtable.data.v2.models.Query;
Expand Down Expand Up @@ -544,7 +544,7 @@ private Builder() {
.putAll(
BigtableStubSettings.defaultApiClientHeaderProviderBuilder().build().getHeaders())
// GrpcHeaderInterceptor treats the `user-agent` as a magic string
.put("user-agent", "bigtable-java/" + Version.VERSION)
.put("user-agent", "bigtable-java/" + GoogleUtils.BIGTABLE_CLIENT_VERSION)
.build();
setInternalHeaderProvider(FixedHeaderProvider.create(headers));

Expand Down

0 comments on commit 22d831c

Please sign in to comment.