core: Use hard-coded string for version

Using META-INF for loading the version is broken on Android and
frequently broken when gRPC is shaded. Having hard-coded strings be
replaced on version bumps has been working well.

Fixes #2098
This commit is contained in:
Eric Anderson 2017-12-11 13:55:36 -08:00
parent a84b406682
commit 1bbe126b44
2 changed files with 2 additions and 9 deletions

View File

@ -64,6 +64,7 @@ $ MAJOR=1 MINOR=7 PATCH=0 # Set appropriately for new release
$ VERSION_FILES=( $ VERSION_FILES=(
build.gradle build.gradle
android-interop-testing/app/build.gradle android-interop-testing/app/build.gradle
core/src/main/java/io/grpc/internal/GrpcUtil.java
examples/build.gradle examples/build.gradle
examples/pom.xml examples/pom.xml
examples/android/helloworld/app/build.gradle examples/android/helloworld/app/build.gradle

View File

@ -195,7 +195,7 @@ public final class GrpcUtil {
public static final Splitter ACCEPT_ENCODING_SPLITTER = Splitter.on(',').trimResults(); public static final Splitter ACCEPT_ENCODING_SPLITTER = Splitter.on(',').trimResults();
private static final String IMPLEMENTATION_VERSION = getImplementationVersion(); private static final String IMPLEMENTATION_VERSION = "1.9.0-SNAPSHOT"; // CURRENT_GRPC_VERSION
/** /**
* The default delay in nanos before we send a keepalive. * The default delay in nanos before we send a keepalive.
@ -741,12 +741,4 @@ public final class GrpcUtil {
} }
private GrpcUtil() {} private GrpcUtil() {}
private static String getImplementationVersion() {
String version = GrpcUtil.class.getPackage().getImplementationVersion();
if (version != null) {
return "/" + version;
}
return "";
}
} }