Skip to content

Commit

Permalink
Merge branch 'main' into java-sample-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
eaball35 authored Dec 6, 2021
2 parents 15782a6 + 6af0e18 commit e65a06b
Show file tree
Hide file tree
Showing 19 changed files with 362 additions and 351 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ name: ci
jobs:
build:
runs-on: ubuntu-latest
container: gcr.io/gapic-images/googleapis-bazel:20210105
# Dockerfile for this image: https://github.com/googleapis/googleapis-discovery/blob/main/Dockerfile
# If you update its version, please also update it below in
# 'Cache Bazel files' - unfortunately it cannot accept variables at this
# time.

strategy:
matrix:
Expand All @@ -28,7 +23,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-bazel-20210105-${{ secrets.CACHE_VERSION }}
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}

- name: Bazel Cache Not Found
if: steps.cache-bazel.outputs.cache-hit != 'true'
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

### [2.2.3](https://www.github.com/googleapis/gapic-generator-java/compare/v2.2.2...v2.2.3) (2021-12-06)


### Bug Fixes

* **deps:** upgrade gax to 2.7.1, protobuf to 3.19.1, grpc to 1.42.1, and truth to 1.1.2, upgrade Bazel in GitHub Actions, and fix build error ([#877](https://www.github.com/googleapis/gapic-generator-java/issues/877)) ([1597707](https://www.github.com/googleapis/gapic-generator-java/commit/1597707e8d525f8abaa058bc0fdcbd3a825032c9))

### [2.2.2](https://www.github.com/googleapis/gapic-generator-java/compare/v2.2.1...v2.2.2) (2021-11-05)


Expand Down
24 changes: 22 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jvm_maven_import_external(
# which in its turn, prioritizes actual generated clients runtime dependencies
# over the generator dependencies.

_gax_java_version = "2.7.0"
_gax_java_version = "2.7.1"

http_archive(
name = "com_google_api_gax_java",
Expand Down Expand Up @@ -65,7 +65,27 @@ load("//:repositories.bzl", "gapic_generator_java_repositories")
gapic_generator_java_repositories()

# protobuf
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
RULES_JVM_EXTERNAL_TAG = "4.2"
RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca"

http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
sha256 = RULES_JVM_EXTERNAL_SHA,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)

load("@com_google_protobuf//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")

load("@rules_jvm_external//:defs.bzl", "maven_install")

maven_install(
artifacts = PROTOBUF_MAVEN_ARTIFACTS,
generate_compat_repositories = True,
repositories = [
"https://repo.maven.apache.org/maven2/",
],
)

protobuf_deps()

Expand Down
8 changes: 4 additions & 4 deletions dependencies.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
# Target workspace name: gapic_generator_java

# Versions only, for dependencies which actual artifacts differ between Bazel and Gradle
version.com_google_protobuf=3.15.8
version.com_google_protobuf=3.19.1
# Version of google-java-format is downgraded from 1.8 to 1.7, because 1.8 supports java 11 minimum, while our JRE is java 8.
version.google_java_format=1.7
version.com_google_api_common_java=1.9.3
version.io_grpc_java=1.30.2
version.io_grpc_java=1.42.1

# Common deps.
maven.com_google_guava_guava=com.google.guava:guava:30.1-android
maven.com_google_code_findbugs_jsr305=com.google.code.findbugs:jsr305:3.0.0
maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.7.2
maven.com_google_auto_value_auto_value_annotations=com.google.auto.value:auto-value-annotations:1.7.2
maven.com_google_code_gson=com.google.code.gson:gson:2.8.6
maven.com_google_protobuf_protobuf_java=com.google.protobuf:protobuf-java:3.15.8
maven.com_google_protobuf_protobuf_java=com.google.protobuf:protobuf-java:3.19.1
maven.io_github_java_diff_utils=io.github.java-diff-utils:java-diff-utils:4.0
maven.javax_annotation_javax_annotation_api=javax.annotation:javax.annotation-api:1.3.2
maven.javax_validation_javax_validation_api=javax.validation:validation-api:2.0.1.Final
Expand All @@ -37,4 +37,4 @@ maven.junit_junit=junit:junit:4.13.1
maven.org_hamcrest_hamcrest_core=org.hamcrest:hamcrest-core:1.3
maven.org_mockito_mockito_core=org.mockito:mockito-core:2.21.0
# Keep in sync with gax-java.
maven.com_google_truth_truth=com.google.truth:truth:1.0
maven.com_google_truth_truth=com.google.truth:truth:1.1.2
2 changes: 1 addition & 1 deletion repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def gapic_generator_java_repositories():
)

# grpc-proto doesn't have releases, so we use hashes instead.
_io_grpc_proto_prefix = "0020624375a8ee4c7dd9b3e513e443b90bc28990" # Aug. 20, 2020.
_io_grpc_proto_prefix = "8e3fec8612bc0708e857950dccadfd5063703e04" # Nov. 6, 2021.
_maybe(
http_archive,
name = "io_grpc_proto",
Expand Down
4 changes: 2 additions & 2 deletions rules_java_gapic/java_gapic_pkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def _java_gapic_build_configs_pkg_impl(ctx):

substitutions = dict(ctx.attr.static_substitutions)
substitutions["{{extra_deps}}"] = _construct_extra_deps({
"compile": ctx.attr.deps,
"testCompile": ctx.attr.test_deps,
"implementation": ctx.attr.deps,
"testImplementation": ctx.attr.test_deps,
}, substitutions)

for template in ctx.attr.templates.items():
Expand Down
20 changes: 7 additions & 13 deletions rules_java_gapic/resources/gradle/assembly.gradle.tmpl
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
buildscript {
repositories {
mavenLocal()
maven {
url 'https://plugins.gradle.org/m2/'
}
mavenCentral()
}
}

subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'java-library'
apply plugin: 'maven-publish'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -23,7 +13,11 @@ subprojects {
}

repositories {
mavenLocal()
mavenCentral()
mavenLocal()
}

publishing.publications {
library(MavenPublication).from components.java
}
}
33 changes: 9 additions & 24 deletions rules_java_gapic/resources/gradle/client_grpc.gradle.tmpl
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
buildscript {
repositories {
mavenCentral()
}
}

apply plugin: 'java'

description = 'GAPIC library for {{name}}'
group = 'com.google.cloud'
version = (findProperty('version') == 'unspecified') ? '0.0.0-SNAPSHOT' : version
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
mavenLocal()
}
version = (version == 'unspecified') ? '0.0.0-SNAPSHOT' : version

compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

dependencies {
compile 'com.google.api:gax:{{version.gax}}'
testCompile 'com.google.api:gax:{{version.gax}}:testlib'
compile 'com.google.api:gax-grpc:{{version.gax_grpc}}'
testCompile 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib'
testCompile 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}'
testCompile '{{maven.junit_junit}}'
implementation 'com.google.api:gax:{{version.gax}}'
testImplementation 'com.google.api:gax:{{version.gax}}:testlib'
implementation 'com.google.api:gax-grpc:{{version.gax_grpc}}'
testImplementation 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib'
testImplementation 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}'
testImplementation '{{maven.junit_junit}}'
{{extra_deps}}
}

Expand Down Expand Up @@ -56,6 +41,6 @@ clean {
task allJars(type: Copy) {
dependsOn test, jar
into 'all-jars'
// Replace with `from configurations.testRuntime, jar` to include test dependencies
from configurations.runtime, jar
// Replace with `from configurations.testRuntimeOnly, jar` to include test dependencies
from configurations.runtimeOnly, jar
}
37 changes: 11 additions & 26 deletions rules_java_gapic/resources/gradle/client_grpcrest.gradle.tmpl
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
buildscript {
repositories {
mavenCentral()
}
}

apply plugin: 'java'

description = 'GAPIC library for {{name}}'
group = 'com.google.cloud'
version = (findProperty('version') == 'unspecified') ? '0.0.0-SNAPSHOT' : version
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
mavenLocal()
}
version = (version == 'unspecified') ? '0.0.0-SNAPSHOT' : version

compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

dependencies {
compile 'com.google.api:gax:{{version.gax}}'
testCompile 'com.google.api:gax:{{version.gax}}:testlib'
compile 'com.google.api:gax-grpc:{{version.gax_grpc}}'
testCompile 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib'
compile 'com.google.api:gax-httpjson:{{version.gax_httpjson}}'
testCompile 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib'
testCompile 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}'
testCompile '{{maven.junit_junit}}'
implementation 'com.google.api:gax:{{version.gax}}'
testImplementation 'com.google.api:gax:{{version.gax}}:testlib'
implementation 'com.google.api:gax-grpc:{{version.gax_grpc}}'
testImplementation 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib'
implementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}'
testImplementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib'
testImplementation 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}'
testImplementation '{{maven.junit_junit}}'
{{extra_deps}}
}

Expand Down Expand Up @@ -58,6 +43,6 @@ clean {
task allJars(type: Copy) {
dependsOn test, jar
into 'all-jars'
// Replace with `from configurations.testRuntime, jar` to include test dependencies
from configurations.runtime, jar
// Replace with `from configurations.testRuntimeOnly, jar` to include test dependencies
from configurations.runtimeOnly, jar
}
31 changes: 8 additions & 23 deletions rules_java_gapic/resources/gradle/client_rest.gradle.tmpl
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
buildscript {
repositories {
mavenCentral()
}
}

apply plugin: 'java'

description = 'GAPIC library for {{name}}'
group = 'com.google.cloud'
version = (findProperty('version') == 'unspecified') ? '0.0.0-SNAPSHOT' : version
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
mavenLocal()
}
version = (version == 'unspecified') ? '0.0.0-SNAPSHOT' : version

compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

dependencies {
compile 'com.google.api:gax:{{version.gax}}'
testCompile 'com.google.api:gax:{{version.gax}}:testlib'
compile 'com.google.api:gax-httpjson:{{version.gax_httpjson}}'
testCompile 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib'
testCompile '{{maven.junit_junit}}'
implementation 'com.google.api:gax:{{version.gax}}'
testImplementation 'com.google.api:gax:{{version.gax}}:testlib'
implementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}'
testImplementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib'
testImplementation '{{maven.junit_junit}}'
{{extra_deps}}
}

Expand Down Expand Up @@ -55,6 +40,6 @@ clean {
task allJars(type: Copy) {
dependsOn test, jar
into 'all-jars'
// Replace with `from configurations.testRuntime, jar` to include test dependencies
from configurations.runtime, jar
// Replace with `from configurations.testRuntimeOnly, jar` to include test dependencies
from configurations.runtimeOnly, jar
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon May 02 22:26:16 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
Loading

0 comments on commit e65a06b

Please sign in to comment.