Skip to content

Commit c3038bf

Browse files
authored
deps: remove dependency on datastore-v1-proto-client module in google-cloud-datastore (#1281)
1 parent 030f7fa commit c3038bf

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

google-cloud-datastore/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242
<groupId>com.google.api.grpc</groupId>
4343
<artifactId>proto-google-cloud-datastore-admin-v1</artifactId>
4444
</dependency>
45-
<dependency>
46-
<groupId>com.google.cloud.datastore</groupId>
47-
<artifactId>datastore-v1-proto-client</artifactId>
48-
</dependency>
4945
<dependency>
5046
<groupId>io.grpc</groupId>
5147
<artifactId>grpc-api</artifactId>

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public class DatastoreOptions extends ServiceOptions<Datastore, DatastoreOptions
4545
private static final String DATASTORE_SCOPE = "https://www.googleapis.com/auth/datastore";
4646
private static final Set<String> SCOPES = ImmutableSet.of(DATASTORE_SCOPE);
4747
private static final String DEFAULT_DATABASE_ID = "";
48+
public static final String PROJECT_ID_ENV_VAR = "DATASTORE_PROJECT_ID";
49+
public static final String LOCAL_HOST_ENV_VAR = "DATASTORE_EMULATOR_HOST";
4850

4951
private final String namespace;
5052
private final String databaseId;
@@ -131,19 +133,13 @@ private DatastoreOptions(Builder builder) {
131133

132134
@Override
133135
protected String getDefaultHost() {
134-
String host =
135-
System.getProperty(
136-
com.google.datastore.v1.client.DatastoreHelper.LOCAL_HOST_ENV_VAR,
137-
System.getenv(com.google.datastore.v1.client.DatastoreHelper.LOCAL_HOST_ENV_VAR));
136+
String host = System.getProperty(LOCAL_HOST_ENV_VAR, System.getenv(LOCAL_HOST_ENV_VAR));
138137
return host != null ? host : DatastoreSettings.getDefaultEndpoint();
139138
}
140139

141140
@Override
142141
protected String getDefaultProject() {
143-
String projectId =
144-
System.getProperty(
145-
com.google.datastore.v1.client.DatastoreHelper.PROJECT_ID_ENV_VAR,
146-
System.getenv(com.google.datastore.v1.client.DatastoreHelper.PROJECT_ID_ENV_VAR));
142+
String projectId = System.getProperty(PROJECT_ID_ENV_VAR, System.getenv(PROJECT_ID_ENV_VAR));
147143
return projectId != null ? projectId : super.getDefaultProject();
148144
}
149145

0 commit comments

Comments
 (0)