/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.pubsublite.internal.wire;

/** The version number of this library. Should be updated whenever the version is updated. */
final class Versions {
  private Versions() {}

  static final int MAJOR_VERSION = 0;
  static final int MINOR_VERSION = 0;
}

@@ -646,149 +646,943 @@
 e;%0A%0A
-/** The version number of this library. Should be updated whenever the version is updated. */%0Afinal class Versions %7B%0A  private Versions() %7B%7D%0A
+import com.google.api.gax.core.GaxProperties;%0A%0A/** The version number of this library.*/%0Afinal class Versions %7B%0A  private Versions() %7B%7D%0A%0A  private static String%5B%5D GetVersionSplits() %7B%0A    try %7B%0A      String versionString = GaxProperties.getLibraryVersion(Versions.class);%0A      return versionString.split(%22.%22);%0A    %7D catch (Exception e) %7B%0A      return new String%5B0%5D;%0A    %7D%0A  %7D%0A%0A  private static int GetMajorVersion() %7B%0A    String%5B%5D splits = GetVersionSplits();%0A    if (splits.length != 3) return 0;%0A    try %7B%0A      return Integer.parseInt(splits%5B0%5D);%0A    %7D catch (NumberFormatException e) %7B%0A      return 0;%0A    %7D%0A  %7D%0A%0A  private static int GetMinorVersion() %7B%0A    String%5B%5D splits = GetVersionSplits();%0A    if (splits.length != 3) return 0;%0A    try %7B%0A      return Integer.parseInt(splits%5B1%5D);%0A    %7D catch (NumberFormatException e) %7B%0A      return 0;%0A    %7D%0A  %7D%0A%0A  // TODO: Do this using generation automation as opposed to maven packaging.
 %0A  s
@@ -1613,17 +1613,33 @@
 RSION = 
-0
+GetMajorVersion()
 ;%0A  stat
@@ -1667,13 +1667,29 @@
 RSION = 
-0
+GetMinorVersion()
 ;%0A%7D%0A

Generate major and minor version numbers using gax. (#42)