Skip to content
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

docs(sample): Add Native Image sample for Storage #1283

Merged
merged 10 commits into from Mar 10, 2022
Merged

Conversation

mpeddada1
Copy link
Contributor

This PR copies over the Storage sample, Setup Instructions and README for native image support from GoogleCloudPlatform/native-image-support-java. It also adds an integration test that can be run as a native image.

Calling mvn package -Pnative -DskipTests builds the native image for the application and calling mvn test -Pnative runs the test as a native image.

For more information: https://graalvm.github.io/native-build-tools/latest/maven-plugin.html#configuration
If you write sample code, please follow the samples format.

@mpeddada1 mpeddada1 requested review from a team as code owners March 2, 2022 00:51
@generated-files-bot
Copy link

Warning: This pull request is touching the following templated files:

  • samples/pom.xml

@product-auto-label product-auto-label bot added api: storage Issues related to the googleapis/java-storage API. samples Issues that are directly related to samples. labels Mar 2, 2022
@suztomo
Copy link
Member

suztomo commented Mar 2, 2022

Checkstyle is failing.

@mpeddada1
Copy link
Contributor Author

Checkstyle is failing.

Hm yeah, it looks it's happening in a couple of PRs and repos. We can wait until it is resolved.

@suztomo
Copy link
Member

suztomo commented Mar 2, 2022

Run actions/setup-java@v[3](https://github.com/googleapis/java-storage/runs/5384705420?check_suite_focus=true#step:3:3)
  with:
    java-version: 8
    java-package: jdk
    architecture: x6[4](https://github.com/googleapis/java-storage/runs/5384705420?check_suite_focus=true#step:3:4)
    check-latest: false
    server-id: github
    server-username: GITHUB_ACTOR
    server-password: GITHUB_TOKEN
    overwrite-settings: true
    job-status: success
Error: Input required and not supplied: distribution

@suztomo
Copy link
Member

suztomo commented Mar 3, 2022

#1286 should fix the checkstyle problem once it's merged.

@Before
public void setUp() {
bout = new ByteArrayOutputStream();
System.setOut(new PrintStream(bout));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, this is bad in that it leaves stdout like this after the tests finish running. So any thing else that might try to write to stdout would still go into memory.

@BenWhitehead
Copy link
Collaborator

LGTM, You might need to rebase to resolve the conflicts from owlbot in README.md. Feel free to merge once able.

@mpeddada1
Copy link
Contributor Author

Thank you!

@mpeddada1 mpeddada1 merged commit 375874d into main Mar 10, 2022
@mpeddada1 mpeddada1 deleted the add-native-sample branch March 10, 2022 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants