Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docker/owlbot/java/cloudbuild_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ steps:
args: ["diff", "-rw", "input", "golden"]
dir: docker/owlbot/java/tests/new-client
waitFor: ["new-client-run"]
- name: "gcr.io/$PROJECT_ID/owlbot-java:$SHORT_SHA"
dir: docker/owlbot/java/tests/new-client-maps/input
id: "new-client-maps-run"
waitFor: [ "build" ]
- name: "bash"
args: [ "diff", "-rw", "input", "golden" ]
dir: docker/owlbot/java/tests/new-client-maps
waitFor: [ "new-client-maps-run" ]
- name: "gcr.io/$PROJECT_ID/owlbot-java:$SHORT_SHA"
dir: docker/owlbot/java/tests/new-version/input
id: "new-version-run"
Expand Down
22 changes: 14 additions & 8 deletions docker/owlbot/java/src/fix-poms.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def load_versions(filename: str, default_group_id: str) -> Mapping[str, module.M
group_id = (
default_group_id
if artifact_id.startswith("google-")
else "com.google.api.grpc"
else _proto_group_id(default_group_id)
)
modules[artifact_id] = module.Module(
group_id=group_id,
Expand Down Expand Up @@ -274,6 +274,12 @@ def update_bom_pom(filename: str, modules: List[module.Module]):

tree.write(filename, pretty_print=True, xml_declaration=True, encoding="utf-8")


def _proto_group_id(group_id: str) -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _proto_group_id(group_id: str) -> str:
def _proto_group_id(main_artifact_group_id: str) -> str:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add source code comment why we had to split the proto group IDs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

prefix = "com.google" if group_id == "com.google.cloud" else group_id
return f"{prefix}.api.grpc"


def main():
print(f"working directory: {os.getcwd()}")
with open(".repo-metadata.json", "r") as fp:
Expand Down Expand Up @@ -353,15 +359,15 @@ def main():
for path in glob.glob("proto-google-*"):
if not path in existing_modules:
existing_modules[path] = module.Module(
group_id="com.google.api.grpc",
group_id=_proto_group_id(group_id),
artifact_id=path,
version=main_module.version,
release_version=main_module.release_version,
)
if path not in excluded_dependencies_list \
and path not in main_module.artifact_id:
required_dependencies[path] = module.Module(
group_id="com.google.api.grpc",
group_id=_proto_group_id(group_id),
artifact_id=path,
version=main_module.version,
release_version=main_module.release_version,
Expand All @@ -378,7 +384,7 @@ def main():
if path not in excluded_dependencies_list \
and path not in main_module.artifact_id:
required_dependencies[path] = module.Module(
group_id="com.google.api.grpc",
group_id=_proto_group_id(group_id),
artifact_id=path,
version=main_module.version,
release_version=main_module.release_version,
Expand All @@ -387,15 +393,15 @@ def main():
for path in glob.glob("grpc-google-*"):
if not path in existing_modules:
existing_modules[path] = module.Module(
group_id="com.google.api.grpc",
group_id=_proto_group_id(group_id),
artifact_id=path,
version=main_module.version,
release_version=main_module.release_version,
)
if path not in excluded_dependencies_list \
and path not in main_module.artifact_id:
required_dependencies[path] = module.Module(
group_id="com.google.api.grpc",
group_id=_proto_group_id(group_id),
artifact_id=path,
version=main_module.version,
release_version=main_module.release_version,
Expand All @@ -415,7 +421,7 @@ def main():
if path not in excluded_dependencies_list \
and path not in main_module.artifact_id:
required_dependencies[path] = module.Module(
group_id="com.google.api.grpc",
group_id=_proto_group_id(group_id),
artifact_id=path,
version=main_module.version,
release_version=main_module.release_version,
Expand Down Expand Up @@ -498,7 +504,7 @@ def main():
for dependency_module in extra_managed_modules:
if dependency_module not in existing_modules:
existing_modules[dependency_module] = module.Module(
group_id="com.google.api.grpc",
group_id=_proto_group_id(group_id),
artifact_id=dependency_module,
version=main_module.version,
release_version=main_module.release_version,
Expand Down
2 changes: 1 addition & 1 deletion docker/owlbot/java/templates/poms/cloud_pom.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</dependency>
{% for module in proto_modules %}
<dependency>
<groupId>com.google.api.grpc</groupId>
<groupId>{{module.group_id}}</groupId>
<artifactId>{{module.artifact_id}}</artifactId>
</dependency>{% endfor %}
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "maps",
"name_pretty": "Example API",
"product_documentation": "https://maps.google.com/foo/",
"api_description": "is an example API",
"client_documentation": "https://googleapis.dev/java/google-maps-foo/latest/index.html",
"release_level": "beta",
"transport": "grpc",
"language": "java",
"repo": "googleapis/java-maps",
"repo_short": "java-maps",
"distribution_name": "com.google.maps:google-maps-foo",
"api_id": "maps.googleapis.com",
"requires_billing": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.maps</groupId>
<artifactId>google-maps-foo-bom</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:google-maps-foo:current} -->
<packaging>pom</packaging>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-config</artifactId>
<version>1.5.3</version>
</parent>

<name>Google Example API BOM</name>
<url>https://github.com/googleapis/java-maps</url>
<description>
BOM for Example API
</description>

<organization>
<name>Google LLC</name>
</organization>

<developers>
<developer>
<id>chingor13</id>
<name>Jeff Ching</name>
<email>[email protected]</email>
<organization>Google LLC</organization>
<roles>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>neenushaji</id>
<name>Neenu Shaji</name>
<email>[email protected]</email>
<organization>Google LLC</organization>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/googleapis/java-maps.git</connection>
<developerConnection>scm:git:[email protected]:googleapis/java-maps.git</developerConnection>
<url>https://github.com/googleapis/java-maps</url>
</scm>

<properties>
<maven.antrun.skip>true</maven.antrun.skip>
</properties>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.maps</groupId>
<artifactId>google-maps-foo</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:google-maps-foo:current} -->
</dependency>
<dependency>
<groupId>com.google.maps.api.grpc</groupId>
<artifactId>grpc-google-maps-foo-v1</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-maps-foo-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.maps.api.grpc</groupId>
<artifactId>proto-google-maps-foo-v1</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:proto-google-maps-foo-v1:current} -->
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.maps</groupId>
<artifactId>google-maps-foo</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:google-maps-foo:current} -->
<packaging>jar</packaging>
<name>Google Example API</name>
<url>https://github.com/googleapis/java-maps</url>
<description>Example API is an example API</description>
<parent>
<groupId>com.google.maps</groupId>
<artifactId>google-maps-foo-parent</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:google-maps-foo:current} -->
</parent>
<properties>
<site.installationModule>google-maps-foo</site.installationModule>
</properties>
<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>api-common</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-common-protos</artifactId>
</dependency>

<dependency>
<groupId>com.google.maps.api.grpc</groupId>
<artifactId>proto-google-maps-foo-v1</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-common-protos</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-iam-v1</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-iam-v1</artifactId>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.13.2</version>
</dependency>

<dependency>
<groupId>com.google.maps.api.grpc</groupId>
<artifactId>grpc-google-maps-foo-v1</artifactId>
<scope>test</scope>
</dependency>
<!-- Need testing utility classes for generated gRPC clients tests -->
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>java9</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2021 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
*
* https://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.maps.foo.v1;

class SomeServiceClient {}
Loading