Skip to content

Commit

Permalink
v2.0 android release
Browse files Browse the repository at this point in the history
  • Loading branch information
ksyeo1010 committed Oct 30, 2023
1 parent 4f99e49 commit 7184707
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
6 changes: 3 additions & 3 deletions binding/android/Octopus/octopus/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

ext {
PUBLISH_GROUP_ID = 'ai.picovoice'
PUBLISH_VERSION = '1.2.2'
PUBLISH_VERSION = '2.0.0'
PUBLISH_ARTIFACT_ID = 'octopus-android'
}

Expand Down Expand Up @@ -39,12 +39,12 @@ dependencies {
}

task copyLibs(type: Copy) {
from("${rootDir}/../../lib/android")
from("${rootDir}/../../../lib/android")
into("${rootDir}/octopus/src/main/jniLibs")
}

task copyParams(type: Copy) {
from("${rootDir}/../../lib/common/param")
from("${rootDir}/../../../lib/common/param")
include('octopus_params.pv')
into("${rootDir}/octopus/src/main/res/raw")
}
Expand Down
3 changes: 3 additions & 0 deletions binding/android/OctopusTestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1276/'
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'ai.picovoice:octopus-android:1.2.2'
implementation 'ai.picovoice:octopus-android:2.0.0'

// Espresso UI Testing
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static Collection<Object[]> initParameters() {
{
"ja",
new HashMap<String, double[][]>() {{
put("りんご", new double [][]{{0.960, 1.664, 1}});
put("りんご", new double [][]{{0.992, 1.632, 1}});
}},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,29 @@ public void testSpacesInSearchPhrase() throws Exception {
metadata.delete();
octopus.delete();
}

@Test
public void testErrorStack() {
String[] error = {};
try {
new Octopus.Builder()
.setAccessKey("invalid")
.build(appContext);
} catch (OctopusException e) {
error = e.getMessageStack();
}

assertTrue(0 < error.length);
assertTrue(error.length <= 8);

try {
new Octopus.Builder()
.setAccessKey("invalid")
.build(appContext);
} catch (OctopusException e) {
for (int i = 0; i < error.length; i++) {
assertEquals(e.getMessageStack()[i], error[i]);
}
}
}
}

0 comments on commit 7184707

Please sign in to comment.