-
Notifications
You must be signed in to change notification settings - Fork 70
doc: Update DEVELOPMENT.md for local development. #1237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
274b12c
995342c
cfdf136
bbf502d
1dc5c1a
1da0fed
9b2bae6
a8b91e0
04a9c3f
8357c36
274e8ee
083e1e5
7edade2
73b6367
25561a4
663e595
a103bd6
1490865
e7d3e5f
5f70202
6d6cc52
6f5b31f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,7 +160,7 @@ $ cd showcase | |
| $ mvn compile -P update | ||
| ``` | ||
|
|
||
| ## Running the Plugin | ||
| ## Running the Plugin under googleapis with local gapic-generator-java | ||
|
|
||
| See also above section "Showcase Integration Testing". | ||
|
|
||
|
|
@@ -171,28 +171,52 @@ To generate a production GAPIC API: | |
| 2. Point to local gapic-generator-java | ||
lqiu96 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Normally, googleapis's build pulls in googleapis/gapic-generator-java from the | ||
| Internet: | ||
|
|
||
| ``` | ||
| # Java microgenerator. | ||
| … | ||
| _gapic_generator_java_version = "2.1.0" | ||
| Internet, we need to build a local SNAPSHOT jar first and point googleapis to the SNAPSHOT jar and local copy of the repo. | ||
lqiu96 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| http_archive( | ||
| name = "gapic_generator_java", | ||
| … | ||
| urls = ["https://github.com/googleapis/gapic-generator-java/archive/v%s.zip" % _gapic_generator_java_version], | ||
| ) | ||
| Before: | ||
| ``` | ||
| _gapic_generator_java_version = "2.13.0" | ||
|
|
||
| maven_install( | ||
| artifacts = [ | ||
| "com.google.api:gapic-generator-java:" + _gapic_generator_java_version, | ||
| ], | ||
| #Update this False for local development | ||
| fail_on_missing_checksum = True, | ||
| repositories = [ | ||
| "m2Local", | ||
| "https://repo.maven.apache.org/maven2/", | ||
| ] | ||
| ) | ||
|
|
||
| http_archive( | ||
| name = "gapic_generator_java", | ||
| strip_prefix = "gapic-generator-java-%s" % _gapic_generator_java_version, | ||
| urls = ["https://github.com/googleapis/gapic-generator-java/archive/v%s.zip" % _gapic_generator_java_version], | ||
| ) | ||
| ``` | ||
|
|
||
| By replacing this portion using the built-in local_repository rule, you can make | ||
| it refer to your local development repo: | ||
| After | ||
|
|
||
| ``` | ||
| local_repository( | ||
| name = "gapic_generator_java", | ||
| path = "/home/<your id>/gapic-generator-java", | ||
| ) | ||
| _gapic_generator_java_version = "2.13.1-SNAPSHOT" | ||
|
|
||
| maven_install( | ||
lqiu96 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| artifacts = [ | ||
| "com.google.api:gapic-generator-java:" + _gapic_generator_java_version, | ||
| ], | ||
| #Update this False for local development | ||
| fail_on_missing_checksum = False, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I'm Bazel novice) Can't this True/False be a variable, based on _gapic-generator_java_version has SNAPSHOT?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's doable as Bazel scripts are basically a Python variant, but we may want to test non-SNAPSHOT version locally sometimes. |
||
| repositories = [ | ||
| "m2Local", | ||
| "https://repo.maven.apache.org/maven2/", | ||
| ] | ||
| ) | ||
|
|
||
| local_repository( | ||
| name = "gapic_generator_java", | ||
| path = "/absolute/path/to/your/local/gapic-generator-java", | ||
| ) | ||
| ``` | ||
|
|
||
| 3. Build the new target. | ||
|
|
@@ -206,6 +230,10 @@ To generate a production GAPIC API: | |
| ``` | ||
| bazel build //google/cloud/speech/v2:google-cloud-speech-v2-java | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
|
|
||
| Note: If you are running into bazel build issues, you can try to remove gapic-generator-java cached in your local m2 | ||
lqiu96 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Try running this command: | ||
| ``` | ||
| rm -rf ~/.m2/repository/com/google/api/ | ||
| ``` | ||
| and then rebuild gapic-generator-java (`mvn clean install`). | ||
Uh oh!
There was an error while loading. Please reload this page.