Skip to content
This repository was archived by the owner on Dec 15, 2023. It is now read-only.

Commit feb6aa9

Browse files
committed
Merge branch 'master' into samples-speech-beta
2 parents 0230ce5 + 72d45ce commit feb6aa9

24 files changed

+2549
-315
lines changed

.kokoro/release/publish_javadoc.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/"
4+
25
env_vars: {
36
key: "STAGING_BUCKET"
47
value: "docs-staging"
58
}
69

10+
env_vars: {
11+
key: "STAGING_BUCKET_V2"
12+
value: "docs-staging-v2-staging"
13+
# Production will be at: docs-staging-v2
14+
}
15+
716
env_vars: {
817
key: "TRAMPOLINE_BUILD_FILE"
918
value: "github/java-speech/.kokoro/release/publish_javadoc.sh"
1019
}
1120

21+
1222
before_action {
1323
fetch_keystore {
1424
keystore_resource {

.kokoro/release/publish_javadoc.sh

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,25 @@ if [[ -z "${STAGING_BUCKET}" ]]; then
2424
exit 1
2525
fi
2626

27+
if [[ -z "${STAGING_BUCKET_V2}" ]]; then
28+
echo "Need to set STAGING_BUCKET_V2 environment variable"
29+
exit 1
30+
fi
31+
2732
# work from the git root directory
2833
pushd $(dirname "$0")/../../
2934

3035
# install docuploader package
3136
python3 -m pip install gcp-docuploader
3237

3338
# compile all packages
34-
mvn clean install -B -DskipTests=true
39+
mvn clean install -B -q -DskipTests=true
3540

3641
NAME=google-cloud-speech
3742
VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)
3843

3944
# build the docs
40-
mvn site -B
45+
mvn site -B -q
4146

4247
pushd target/site/apidocs
4348

@@ -53,3 +58,19 @@ python3 -m docuploader upload . \
5358
--staging-bucket ${STAGING_BUCKET}
5459

5560
popd
61+
62+
# V2
63+
mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/"
64+
65+
pushd target/devsite
66+
67+
# create metadata
68+
python3 -m docuploader create-metadata \
69+
--name ${NAME} \
70+
--version ${VERSION} \
71+
--language java
72+
73+
# upload docs
74+
python3 -m docuploader upload . \
75+
--credentials ${CREDENTIALS} \
76+
--staging-bucket ${STAGING_BUCKET_V2}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
1717
<dependency>
1818
<groupId>com.google.cloud</groupId>
1919
<artifactId>libraries-bom</artifactId>
20-
<version>8.0.0</version>
20+
<version>8.1.0</version>
2121
<type>pom</type>
2222
<scope>import</scope>
2323
</dependency>

google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechSmokeTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public class SpeechSmokeTest {
2828

2929
@Test
3030
public void run() {
31+
// Skip smoke tests if running in VPCSC because our V1 integration tests
32+
// cover VPC-SC.
33+
Assume.assumeTrue(System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC") == null);
3134
main(null);
3235
}
3336

3437
public static void main(String args[]) {
3538
Logger.getLogger("").setLevel(Level.WARNING);
36-
// Skip smoke tests if running in VPCSC because our V1 integration tests
37-
// cover VPC-SC.
38-
Assume.assumeTrue(System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC") == null);
3939
try {
4040
executeNoCatch();
4141
System.out.println("OK");

google-cloud-speech/src/test/java/com/google/cloud/speech/v1/it/ITSpeechTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void tearDownClass() throws Exception {
5252

5353
@Test
5454
public void syncRecognize() {
55-
RecognizeResponse response = speechClient.recognize(config(), audio());
55+
RecognizeResponse response = speechClient.recognize(config(2), audio());
5656

5757
Truth.assertThat(response.getResultsCount()).isGreaterThan(0);
5858
Truth.assertThat(response.getResults(0).getAlternativesCount()).isGreaterThan(0);
@@ -63,7 +63,7 @@ public void syncRecognize() {
6363
@Test
6464
public void longrunningRecognize() throws Exception {
6565
LongRunningRecognizeResponse response =
66-
speechClient.longRunningRecognizeAsync(config(), audio()).get();
66+
speechClient.longRunningRecognizeAsync(config(2), audio()).get();
6767

6868
Truth.assertThat(response.getResultsCount()).isGreaterThan(0);
6969
Truth.assertThat(response.getResults(0).getAlternativesCount()).isGreaterThan(0);
@@ -78,7 +78,7 @@ public void streamingRecognize() throws Exception {
7878
.toByteArray();
7979

8080
StreamingRecognitionConfig streamingConfig =
81-
StreamingRecognitionConfig.newBuilder().setConfig(config()).build();
81+
StreamingRecognitionConfig.newBuilder().setConfig(config(1)).build();
8282

8383
ResponseApiStreamingObserver<StreamingRecognizeResponse> responseObserver =
8484
new ResponseApiStreamingObserver<>();
@@ -133,7 +133,7 @@ public SettableFuture<List<T>> future() {
133133
}
134134
}
135135

136-
private RecognitionConfig config() {
136+
private RecognitionConfig config(int channels) {
137137
String languageCode = "en-US";
138138
int sampleRateHertz = 44100;
139139
RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
@@ -142,6 +142,7 @@ private RecognitionConfig config() {
142142
.setLanguageCode(languageCode)
143143
.setSampleRateHertz(sampleRateHertz)
144144
.setEncoding(encoding)
145+
.setAudioChannelCount(channels)
145146
.build();
146147
return config;
147148
}
@@ -151,6 +152,8 @@ public RecognitionAudio audio() {
151152
if (audio_gcs_uri != null) {
152153
return RecognitionAudio.newBuilder().setUri(audio_gcs_uri).build();
153154
}
154-
return RecognitionAudio.newBuilder().setUri("gs://gapic-toolkit/hello.flac").build();
155+
return RecognitionAudio.newBuilder()
156+
.setUri("gs://cloud-samples-data/speech/hello.flac")
157+
.build();
155158
}
156159
}

google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechSmokeTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public class SpeechSmokeTest {
2828

2929
@Test
3030
public void run() {
31+
// Skip smoke tests if running in VPCSC because our V1 integration tests
32+
// cover VPC-SC.
33+
Assume.assumeTrue(System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC") == null);
3134
main(null);
3235
}
3336

3437
public static void main(String args[]) {
3538
Logger.getLogger("").setLevel(Level.WARNING);
36-
// Skip smoke tests if running in VPCSC because our V1 integration tests
37-
// cover VPC-SC.
38-
Assume.assumeTrue(System.getenv("GOOGLE_CLOUD_TESTS_IN_VPCSC") == null);
3939
try {
4040
executeNoCatch();
4141
System.out.println("OK");

samples/install-without-bom/pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
<version>1.24.0</version>
3333
</dependency>
3434
<!-- [END speech_install_without_bom] -->
35-
35+
<dependency>
36+
<groupId>commons-cli</groupId>
37+
<artifactId>commons-cli</artifactId>
38+
<version>1.4</version>
39+
</dependency>
3640
<dependency>
3741
<groupId>junit</groupId>
3842
<artifactId>junit</artifactId>

samples/snapshot/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
<version>1.24.1-SNAPSHOT</version>
3333
</dependency>
3434
<!-- {x-version-update-end} -->
35+
<dependency>
36+
<groupId>commons-cli</groupId>
37+
<artifactId>commons-cli</artifactId>
38+
<version>1.4</version>
39+
</dependency>
3540
<dependency>
3641
<groupId>junit</groupId>
3742
<artifactId>junit</artifactId>

samples/snippets/pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@
4242
<groupId>com.google.cloud</groupId>
4343
<artifactId>google-cloud-speech</artifactId>
4444
</dependency>
45-
<!-- [END speech_install_with_bom] -->
46-
45+
<!-- [START_EXCLUDE] -->
46+
<dependency>
47+
<groupId>commons-cli</groupId>
48+
<artifactId>commons-cli</artifactId>
49+
<version>1.4</version>
50+
</dependency>
4751
<dependency>
4852
<groupId>junit</groupId>
4953
<artifactId>junit</artifactId>
@@ -56,5 +60,7 @@
5660
<version>1.0.1</version>
5761
<scope>test</scope>
5862
</dependency>
63+
<!-- [END_EXCLUDE] -->
5964
</dependencies>
65+
<!-- [END speech_install_with_bom] -->
6066
</project>

0 commit comments

Comments
 (0)