Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
Cleanup dependencies and examples. (#94)
Browse files Browse the repository at this point in the history
* Fix examples and remove grpc-netty.

* Deprecate the constructor with api path.

* Remove API guice module.

* Fix some extra dependencies on guice-api.
  • Loading branch information
Bogdan Drutu authored Sep 21, 2017
1 parent cd6a3e5 commit c53f291
Show file tree
Hide file tree
Showing 23 changed files with 102 additions and 318 deletions.
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,18 @@ The following sample writes a trace span to the Stackdriver Trace API using gRPC
<dependencies>
<dependency>
<groupId>com.google.cloud.trace</groupId>
<artifactId>trace-grpc-api-service</artifactId>
<artifactId>core</artifactId>
<version>VERSION</version>
</dependency>
<dependency>
<groupId>com.google.cloud.trace</groupId>
<artifactId>core</artifactId>
<artifactId>service</artifactId>
<version>VERSION</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>0.4.0</version>
</dependency>
<!-- gRPC dependencies -->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>1.1.33.Fork23</version>
<groupId>com.google.cloud.trace</groupId>
<artifactId>trace-grpc-api-service</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
```
Expand Down
26 changes: 0 additions & 26 deletions guice/api/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions guice/grpc-sink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
<artifactId>grpc-consumer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>guice-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>guice-v1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import com.google.auth.Credentials;
import com.google.cloud.trace.grpc.v1.GrpcTraceConsumer;
import com.google.cloud.trace.guice.api.ApiHost;
import com.google.cloud.trace.guice.v1.ApiTraceSink;
import com.google.cloud.trace.v1.consumer.TraceConsumer;
import com.google.inject.AbstractModule;
Expand All @@ -31,8 +30,8 @@ protected void configure() {}
@Provides
@ApiTraceSink
@Singleton
TraceConsumer provideTraceSink(@ApiHost String apiHost, Credentials credentials)
TraceConsumer provideTraceSink(Credentials credentials)
throws IOException {
return GrpcTraceConsumer.create(apiHost, credentials);
return GrpcTraceConsumer.createWithCredentials(credentials);
}
}
1 change: 0 additions & 1 deletion guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

<modules>
<module>annotation</module>
<module>api</module>
<module>core</module>
<module>google-auth</module>
<module>grpc-sink</module>
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.6.1</grpc.version>
<netty-boringssl.version>2.0.5.Final</netty-boringssl.version>
<google-cloud-trace.version>0.24.0-alpha</google-cloud-trace.version>
<google-auth-library-credentials.version>0.8.0</google-auth-library-credentials.version>
<google-auth-library-oauth2-http.version>0.8.0</google-auth-library-oauth2-http.version>
Expand Down
13 changes: 13 additions & 0 deletions samples/basic-logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,17 @@
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<configuration>
<mainClass>com.google.cloud.trace.samples.logging.basic.BasicLogging</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
43 changes: 0 additions & 43 deletions samples/buffering-grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,53 +41,10 @@
<artifactId>sink</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>${google-auth-library-oauth2-http.version}</version>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${netty-boringssl.version}</version>
<classifier>${os.detected.classifier}</classifier>
</dependency>
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.5.0.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<condition property="tcnative.classifier" value="${os.detected.classifier}-fedora" else="${os.detected.classifier}">
<isset property="os.detected.release.fedora" />
</condition>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void main(String[] args) throws IOException {

// Create the trace sink.
TraceProducer traceProducer = new TraceProducer();
TraceConsumer traceConsumer = GrpcTraceConsumer.create("cloudtrace.googleapis.com",
TraceConsumer traceConsumer = GrpcTraceConsumer.createWithCredentials(
GoogleCredentials.fromStream(new FileInputStream(clientSecretsFile))
.createScoped(Arrays.asList("https://www.googleapis.com/auth/trace.append")));
FlushableTraceConsumer flushableSink = new SimpleBufferingTraceConsumer(traceConsumer);
Expand Down
42 changes: 0 additions & 42 deletions samples/guice-scheduled-grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>guice-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>guice-core</artifactId>
Expand Down Expand Up @@ -74,47 +69,10 @@
<artifactId>guice</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${netty-boringssl.version}</version>
<classifier>${os.detected.classifier}</classifier>
</dependency>
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.5.0.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<condition property="tcnative.classifier" value="${os.detected.classifier}-fedora" else="${os.detected.classifier}">
<isset property="os.detected.release.fedora" />
</condition>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.google.cloud.trace.guice.StackTraceDisabledModule;
import com.google.cloud.trace.guice.SpanContextHandlerTracerModule;
import com.google.cloud.trace.guice.TraceEnabledModule;
import com.google.cloud.trace.guice.api.ApiHostModule;
import com.google.cloud.trace.guice.auth.ClientSecretsFilePropertiesModule;
import com.google.cloud.trace.guice.auth.ClientSecretsGoogleCredentialsModule;
import com.google.cloud.trace.guice.auth.TraceAppendScopesModule;
Expand Down Expand Up @@ -58,7 +57,6 @@ public static void main(String[] args) {
new SinkBufferSizePropertiesModule(),
new SinkScheduledDelayPropertiesModule(),
new SingleThreadScheduledExecutorModule(),
new ApiHostModule(),
new ClientSecretsGoogleCredentialsModule(),
new ClientSecretsFilePropertiesModule(),
new TraceAppendScopesModule());
Expand Down
43 changes: 0 additions & 43 deletions samples/guice-servlet-grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
<artifactId>guice-annotation</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>guice-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>guice-core</artifactId>
Expand Down Expand Up @@ -89,48 +84,10 @@
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${netty-boringssl.version}</version>
<classifier>${os.detected.classifier}</classifier>
</dependency>
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.5.0.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<condition property="tcnative.classifier" value="${os.detected.classifier}-fedora" else="${os.detected.classifier}">
<isset property="os.detected.release.fedora" />
</condition>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.cloud.trace.guice.StackTraceDisabledModule;
import com.google.cloud.trace.guice.SpanContextHandlerTracerModule;
import com.google.cloud.trace.guice.annotation.TracerSpanModule;
import com.google.cloud.trace.guice.api.ApiHostModule;
import com.google.cloud.trace.guice.auth.ClientSecretsFileJndiModule;
import com.google.cloud.trace.guice.auth.ClientSecretsGoogleCredentialsModule;
import com.google.cloud.trace.guice.auth.TraceAppendScopesModule;
Expand Down Expand Up @@ -57,7 +56,6 @@ protected Injector getInjector() {
new SinkBufferSizeJndiModule(),
new SinkScheduledDelayJndiModule(),
new SingleThreadScheduledExecutorModule(),
new ApiHostModule(),
new ClientSecretsGoogleCredentialsModule(),
new ClientSecretsFileJndiModule(),
new TraceAppendScopesModule(),
Expand Down
Loading

0 comments on commit c53f291

Please sign in to comment.