Skip to content

Commit

Permalink
Merge branch 'main' into explicit-dynamic-routing-header
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeli0 authored Jan 28, 2022
2 parents ef5e022 + 50a8693 commit f29f222
Show file tree
Hide file tree
Showing 23 changed files with 155 additions and 393 deletions.
33 changes: 33 additions & 0 deletions PROPERTIES.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
PROPERTIES = {
"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.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.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",

# Gapic YAML parsing for batching settings.
"maven.org_yaml_snakeyaml": "org.yaml:snakeyaml:1.26",

# ServiceStubSettings class. Used only in generated code.
"maven.org_threeten_threetenbp": "org.threeten:threetenbp:1.3.3",

# Testing.
"maven.junit_junit": "junit:junit:4.13.1",
# This hamcrest-core dependency is for running JUnit test manually, before JUnit 4.11 it's wrapped along with JUnit package.
# But now it has to be explicitly added.
"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.1.2",
}
8 changes: 0 additions & 8 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ load("@com_google_api_gax_java//:repositories.bzl", "com_google_api_gax_java_rep

com_google_api_gax_java_repositories()

load("//:repository_rules.bzl", "gapic_generator_java_properties")

gapic_generator_java_properties(
name = "gapic_generator_java_properties",
file = "//:dependencies.properties",
)

load("@gapic_generator_java_properties//:dependencies.properties.bzl", "PROPERTIES")
load("//:repositories.bzl", "gapic_generator_java_repositories")

gapic_generator_java_repositories()
Expand Down
40 changes: 0 additions & 40 deletions dependencies.properties

This file was deleted.

2 changes: 1 addition & 1 deletion repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
load("@gapic_generator_java_properties//:dependencies.properties.bzl", "PROPERTIES")
load("//:PROPERTIES.bzl", "PROPERTIES")

def gapic_generator_java_repositories():
# Import dependencies shared between Gradle and Bazel (i.e. maven dependencies)
Expand Down
49 changes: 0 additions & 49 deletions repository_rules.bzl

This file was deleted.

89 changes: 0 additions & 89 deletions rules_bazel/java/integration_test.bzl

This file was deleted.

84 changes: 0 additions & 84 deletions rules_bazel/java/java_diff_test.bzl

This file was deleted.

1 change: 1 addition & 0 deletions rules_java_gapic/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pkg_tar(
files = {
"resources/gradle/gradle/wrapper/gradle-wrapper.jar": "gradle/wrapper/gradle-wrapper.jar",
"resources/gradle/gradle/wrapper/gradle-wrapper.properties": "gradle/wrapper/gradle-wrapper.properties",
"resources/gradle/gradle.properties": "gradle.properties",
"resources/gradle/gradlew": "gradlew",
"resources/gradle/gradlew.bat": "gradlew.bat",
},
Expand Down
1 change: 1 addition & 0 deletions rules_java_gapic/resources/gradle/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.jvmargs=-Xmx2048m
2 changes: 1 addition & 1 deletion scripts/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package(default_visibility = ["//test/integration:__pkg__"])

exports_files(["diff_gen_and_golden.sh"])
exports_files(["diff_gen_and_golden.sh", "update_golden.sh"])
6 changes: 3 additions & 3 deletions scripts/diff_gen_and_golden.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ RAW_SRCJAR=$( find . -name '*_java_gapic_srcjar_raw.srcjar' )
mkdir unpacked src
cd unpacked
unzip -q -c "../${RAW_SRCJAR}" temp-codegen.srcjar | jar x
cp -rf src/main/java/* ../src
cp -rf src/test/java/* ../src
[ -d proto ] && cp -rf proto/src/main/java/* ../src
cp -r src/main/java/* ../src
cp -r src/test/java/* ../src
[ -d proto ] && cp -r proto/src/main/java/* ../src
cd ..

# Remove unneeded non-Java files, like MANIFEST
Expand Down
25 changes: 25 additions & 0 deletions scripts/update_golden.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

set -o errexit

API_NAME=$1
RAW_SRCJAR=$( find . -name '*_java_gapic_srcjar_raw.srcjar' )

rm -rf srcjar_unpacked
mkdir srcjar_unpacked
cd srcjar_unpacked
UNPACK_DIR=$PWD
unzip -q -c "../${RAW_SRCJAR}" temp-codegen.srcjar | jar x

cd ${BUILD_WORKSPACE_DIRECTORY}/test/integration/goldens/${API_NAME}

# clear out existing Java and JSON files.
find . -name '*.java' -delete
find . -name 'gapic_metadata.json' -delete

cp -r ${UNPACK_DIR}/src/main/java/* .
cp -r ${UNPACK_DIR}/src/test/java/* .
[ -d ${UNPACK_DIR}/proto ] && cp -r ${UNPACK_DIR}/proto/src/main/java/* .

find . -name 'PlaceholderFile.java' -delete
find . -type d -empty -delete
Loading

0 comments on commit f29f222

Please sign in to comment.