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

Commit

Permalink
samples: add presubmit lint check (#216)
Browse files Browse the repository at this point in the history
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* chore(java_templates): add lint/static analysis presubmit checks for samples

* chore(java_templates): add lint/static analysis presubmit checks for samples

* chore: fix trailing whitespace

Source-Author: Jeff Ching <chingor@google.com>
Source-Date: Mon Aug 17 14:29:16 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: c3caf0704f25a0c365f1c315e804a30b87c62a75
Source-Link: googleapis/synthtool@c3caf07

* chore(java_templates): stop running pmd/spotbugs checks for samples

This was creating too much noise. We will revisit with other options and/or tune these checks.

Source-Author: Jeff Ching <chingor@google.com>
Source-Date: Wed Aug 19 12:26:49 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 9602086c6c5b05db77950c7f7495a2a3868f3537
Source-Link: googleapis/synthtool@9602086

* chore: fix line length

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
yoshi-automation and chingor13 committed Aug 27, 2020
1 parent 83fbae3 commit b25fc37
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/samples.yaml
@@ -0,0 +1,14 @@
on:
pull_request:
name: samples
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Run checkstyle
run: mvn -P lint --quiet --batch-mode checkstyle:check
working-directory: samples/snippets
21 changes: 20 additions & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>9.0.0</version>
<version>9.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -29,6 +29,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-texttospeech</artifactId>
</dependency>
</dependencies>

```

Expand Down Expand Up @@ -86,6 +87,24 @@ use this Cloud Text-to-Speech Client Library.



## Samples

Samples are in the [`samples/`](https://github.com/googleapis/java-texttospeech/tree/master/samples) directory. The samples' `README.md`
has instructions for running the samples.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| List All Supported Voices | [source code](https://github.com/googleapis/java-texttospeech/blob/master/samples/snippets/src/main/java/com/example/texttospeech/ListAllSupportedVoices.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-texttospeech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/texttospeech/ListAllSupportedVoices.java) |
| List All Supported Voices Beta | [source code](https://github.com/googleapis/java-texttospeech/blob/master/samples/snippets/src/main/java/com/example/texttospeech/ListAllSupportedVoicesBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-texttospeech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/texttospeech/ListAllSupportedVoicesBeta.java) |
| Quickstart Sample | [source code](https://github.com/googleapis/java-texttospeech/blob/master/samples/snippets/src/main/java/com/example/texttospeech/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-texttospeech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/texttospeech/QuickstartSample.java) |
| Quickstart Sample Beta | [source code](https://github.com/googleapis/java-texttospeech/blob/master/samples/snippets/src/main/java/com/example/texttospeech/QuickstartSampleBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-texttospeech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/texttospeech/QuickstartSampleBeta.java) |
| Ssml Addresses | [source code](https://github.com/googleapis/java-texttospeech/blob/master/samples/snippets/src/main/java/com/example/texttospeech/SsmlAddresses.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-texttospeech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/texttospeech/SsmlAddresses.java) |
| Synthesize File | [source code](https://github.com/googleapis/java-texttospeech/blob/master/samples/snippets/src/main/java/com/example/texttospeech/SynthesizeFile.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-texttospeech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/texttospeech/SynthesizeFile.java) |
| Synthesize File Beta | [source code](https://github.com/googleapis/java-texttospeech/blob/master/samples/snippets/src/main/java/com/example/texttospeech/SynthesizeFileBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-texttospeech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/texttospeech/SynthesizeFileBeta.java) |
| Synthesize Text | [source code](https://github.com/googleapis/java-texttospeech/blob/master/samples/snippets/src/main/java/com/example/texttospeech/SynthesizeText.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-texttospeech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/texttospeech/SynthesizeText.java) |
| Synthesize Text Beta | [source code](https://github.com/googleapis/java-texttospeech/blob/master/samples/snippets/src/main/java/com/example/texttospeech/SynthesizeTextBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-texttospeech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/texttospeech/SynthesizeTextBeta.java) |



## Troubleshooting

Expand Down
Expand Up @@ -35,7 +35,8 @@

/**
* Google Cloud TextToSpeech API sample application. Example usage: mvn package
* exec:java-Dexec.mainClass='com.example.texttospeech.SynthesizeTextBeta' -Dexec.args='--text "hello"'
* exec:java-Dexec.mainClass='com.example.texttospeech.SynthesizeTextBeta' -Dexec.args='--text
* "hello"'
*/
public class SynthesizeTextBeta {

Expand Down
5 changes: 3 additions & 2 deletions synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-texttospeech.git",
"sha": "13d7e5bce8908a342441e9de8862f62e094fb4a7"
"sha": "83fbae35d964b80da8b4aaca0164f4340a7dfbbb"
}
},
{
Expand All @@ -27,7 +27,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "f8823dec98277a9516f2fb6fae9f58b3a59a23e1"
"sha": "9602086c6c5b05db77950c7f7495a2a3868f3537"
}
}
],
Expand Down Expand Up @@ -60,6 +60,7 @@
".github/release-please.yml",
".github/trusted-contribution.yml",
".github/workflows/ci.yaml",
".github/workflows/samples.yaml",
".kokoro/build.bat",
".kokoro/build.sh",
".kokoro/coerce_logs.sh",
Expand Down

0 comments on commit b25fc37

Please sign in to comment.