Skip to content

Commit

Permalink
chore: relocate gapic-generator-java pom.xml to subfolder (#1105)
Browse files Browse the repository at this point in the history
* chore: relocate gapic-generator-java pom.xml to subfolder

* fix: ensure all tests work with new project structure

* fix: set surefire working directory, and revert source adjustments

* fix: formatter
  • Loading branch information
burkedavison authored Nov 30, 2022
1 parent eed1de7 commit dbf9342
Show file tree
Hide file tree
Showing 14 changed files with 432 additions and 338 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ target/
# IDE
.idea
.ijwb
*.iml

# Vim.
*.sw*
Expand Down
388 changes: 388 additions & 0 deletions gapic-generator-java/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,388 @@
<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.api</groupId>
<artifactId>gapic-generator-java</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Should be in sync with repositories.bzl -->
<googleapis.commit>44d6bef0ca6db8bba3fb324c8186e694bcc4829c</googleapis.commit>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-dependencies</artifactId>
<version>3.0.6</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<sourceDirectory>../src/main/java</sourceDirectory>
<resources>
<resource>
<directory>../src/</directory>
</resource>
</resources>
<testSourceDirectory>../src/test/java</testSourceDirectory>
<directory>../target</directory>

<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>

<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>8</source>
<target>8</target>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>1.10.1</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>

<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.9.1</version>
</plugin>

<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.6.8</version>
<executions>
<execution>
<id>download-metadata-proto</id>
<phase>generate-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>
https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/gapic/metadata/gapic_metadata.proto
</url>
<outputDirectory>../target/generated-sources/proto</outputDirectory>
</configuration>
</execution>
<execution>
<id>download-common-resources-proto</id>
<phase>generate-test-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>
https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/cloud/common_resources.proto
</url>
<outputDirectory>../target/generated-test-sources/proto</outputDirectory>
</configuration>
</execution>
<execution>
<id>download-pubsub-proto</id>
<phase>generate-test-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>
https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/pubsub.proto
</url>
<outputDirectory>../target/generated-test-sources/proto</outputDirectory>
</configuration>
</execution>
<execution>
<id>download-schema-proto</id>
<phase>generate-test-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>
https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/schema.proto
</url>
<outputDirectory>../target/generated-test-sources/proto/google/pubsub/v1
</outputDirectory>
</configuration>
</execution>
<execution>
<id>download-logging-proto</id>
<phase>generate-test-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>
https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging.proto
</url>
<outputDirectory>../target/generated-test-sources/proto</outputDirectory>
</configuration>
</execution>
<execution>
<id>download-log-entry-proto</id>
<phase>generate-test-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>
https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/log_entry.proto
</url>
<outputDirectory>../target/generated-test-sources/proto/google/logging/v2
</outputDirectory>
</configuration>
</execution>
<execution>
<id>download-logging-config-proto</id>
<phase>generate-test-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>
https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_config.proto
</url>
<outputDirectory>../target/generated-test-sources/proto/google/logging/v2
</outputDirectory>
</configuration>
</execution>
<execution>
<id>download-logging-metrics-proto</id>
<phase>generate-test-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>
https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_metrics.proto
</url>
<outputDirectory>../target/generated-test-sources/proto/google/logging/v2
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier}
</protocArtifact>
</configuration>
<executions>
<execution>
<id>compile-protos</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<protoSourceRoot>../src/main/proto</protoSourceRoot>
</configuration>
</execution>
<execution>
<id>compile-downloaded-protos</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<protoSourceRoot>../target/generated-sources/proto</protoSourceRoot>
<clearOutputDirectory>false</clearOutputDirectory>
</configuration>
</execution>
<execution>
<id>compile-test-protos</id>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<protoTestSourceRoot>../src/test/proto</protoTestSourceRoot>
<writeDescriptorSet>true</writeDescriptorSet>
<includeSourceInfoInDescriptorSet>true</includeSourceInfoInDescriptorSet>
<includeDependenciesInDescriptorSet>true</includeDependenciesInDescriptorSet>
<descriptorSetFileName>test-proto.descriptorset</descriptorSetFileName>
</configuration>
</execution>
<execution>
<id>compile-downloaded-test-protos</id>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<protoTestSourceRoot>../target/generated-test-sources/proto</protoTestSourceRoot>
<clearOutputDirectory>false</clearOutputDirectory>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>
../target/generated-test-resources/protobuf/descriptor-sets
</additionalClasspathElement>
</additionalClasspathElements>
<workingDirectory>../</workingDirectory>
</configuration>
</plugin>

<!-- Code coverage for SonarCloud -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<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</artifactId>
<classifier>testlib</classifier>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<classifier>testlib</classifier>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<classifier>testlib</classifier>
</dependency>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
</dependency>
<dependency>
<groupId>com.google.googlejavaformat</groupId>
<artifactId>google-java-format</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>

<!--
TODO: remove when dropping Java 8.
https://github.com/googleapis/gapic-generator-java/issues/888
-->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>

<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.java-diff-utils</groupId>
<artifactId>java-diff-utils</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit dbf9342

Please sign in to comment.