Skip to content

Commit e100b0f

Browse files
committed
---
yaml --- r: 5061 b: refs/heads/master c: f9cca55 h: refs/heads/master i: 5059: e59ae39
1 parent 4f388b7 commit e100b0f

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: fbb8f8298a5153828bdeb6b0c24c81820e233a73
2+
refs/heads/master: f9cca55771d18439dad30de6639958f0e4581c1f
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 7406918e071dd2c5677a638ae2a06e7592b6542c
55
refs/heads/pubsub-alpha: d6bbd32eed6cb48cda8d6798ee70ddd6bfc1f07d

trunk/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Most `google-cloud` libraries require a project ID. There are multiple ways to
9595
```java
9696
Datastore datastore = DatastoreOptions.builder().projectId("PROJECT_ID").build().service();
9797
```
98-
* Specify the environment variable `GCLOUD_PROJECT` to be your desired project ID.
98+
* Specify the environment variable `GOOGLE_CLOUD_PROJECT` to be your desired project ID.
9999
* Set the project ID using the [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en). To use the SDK, [download the SDK](https://cloud.google.com/sdk/?hl=en) if you haven't already, and set the project ID from the command line. For example:
100100

101101
```
@@ -105,7 +105,7 @@ Most `google-cloud` libraries require a project ID. There are multiple ways to
105105
`google-cloud` determines the project ID from the following sources in the listed order, stopping once it finds a value:
106106

107107
1. Project ID supplied when building the service options
108-
2. Project ID specified by the environment variable `GCLOUD_PROJECT`
108+
2. Project ID specified by the environment variable `GOOGLE_CLOUD_PROJECT`
109109
3. App Engine project ID
110110
4. Project ID specified in the JSON credentials file pointed by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable
111111
5. Google Cloud SDK project ID

trunk/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ public abstract class ServiceOptions<ServiceT extends Service<OptionsT>, Service
6464
OptionsT extends ServiceOptions<ServiceT, ServiceRpcT, OptionsT>> implements Serializable {
6565

6666
private static final String DEFAULT_HOST = "https://www.googleapis.com";
67-
private static final String PROJECT_ENV_NAME = "GCLOUD_PROJECT";
67+
private static final String LEGACY_PROJECT_ENV_NAME = "GCLOUD_PROJECT";
68+
private static final String PROJECT_ENV_NAME = "GOOGLE_CLOUD_PROJECT";
6869
private static final String MANIFEST_ARTIFACT_ID_KEY = "artifactId";
6970
private static final String MANIFEST_VERSION_KEY = "Implementation-Version";
70-
private static final String ARTIFACT_ID = "gcloud-java-core";
71+
private static final String ARTIFACT_ID = "google-cloud-core";
7172
private static final String LIBRARY_NAME = "gcloud-java";
7273
private static final String LIBRARY_VERSION = getLibraryVersion();
7374
private static final String APPLICATION_NAME =
@@ -261,6 +262,10 @@ protected String defaultHost() {
261262

262263
protected String defaultProject() {
263264
String projectId = System.getProperty(PROJECT_ENV_NAME, System.getenv(PROJECT_ENV_NAME));
265+
if (projectId == null) {
266+
projectId =
267+
System.getProperty(LEGACY_PROJECT_ENV_NAME, System.getenv(LEGACY_PROJECT_ENV_NAME));
268+
}
264269
if (projectId == null) {
265270
projectId = appEngineProjectId();
266271
}

trunk/google-cloud-examples/src/main/java/com/google/cloud/examples/datastore/DatastoreExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class DatastoreExample {
5353

5454
private static final String USER_KIND = "_DS_EXAMPLE_USER";
5555
private static final String COMMENT_KIND = "_DS_EXAMPLE_COMMENT";
56-
private static final String NAMESPACE = "gcloud_java_example";
56+
private static final String NAMESPACE = "google_cloud_example";
5757
private static final String DEFAULT_ACTION = "display";
5858
private static final Map<String, DatastoreAction> ACTIONS = new HashMap<>();
5959

0 commit comments

Comments
 (0)