From d42d20189a0fa6caef6a22d6f2a5d6cc55173a4c Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Nov 2022 10:44:18 -0600 Subject: [PATCH 1/9] Update Android dependencies and example. --- Cargo.toml | 5 +-- examples/android/app/build.gradle | 30 ++++++++--------- .../android/app/src/main/AndroidManifest.xml | 4 +-- examples/android/build.gradle | 32 +++++++++---------- examples/android/cargo.toml | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/android/settings.gradle | 9 +++++- src/backends/android.rs | 12 +++---- 8 files changed, 52 insertions(+), 44 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1627c7b..30a5e1b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,8 +45,9 @@ wasm-bindgen = "0.2" web-sys = { version = "0.3", features = ["EventTarget", "SpeechSynthesis", "SpeechSynthesisErrorCode", "SpeechSynthesisErrorEvent", "SpeechSynthesisEvent", "SpeechSynthesisUtterance", "SpeechSynthesisVoice", "Window", ] } [target.'cfg(target_os="android")'.dependencies] -jni = "0.19" -ndk-glue = "0.6" +jni = "0.20" +ndk-context = "0.1" +ndk-glue = "0.7" [package.metadata.docs.rs] no-default-features = true \ No newline at end of file diff --git a/examples/android/app/build.gradle b/examples/android/app/build.gradle index 2e99b3c..be6cfad 100644 --- a/examples/android/app/build.gradle +++ b/examples/android/app/build.gradle @@ -1,16 +1,16 @@ plugins { id "com.android.application" - id "kotlin-android" + id "org.mozilla.rust-android-gradle.rust-android" } android { - compileSdkVersion 30 - buildToolsVersion "30.0.3" - + namespace "rs.tts" + compileSdkVersion 33 + ndkVersion "25.1.8937393" defaultConfig { applicationId "rs.tts" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 33 versionCode 1 versionName "1.0" } @@ -21,27 +21,27 @@ android { proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "androidx.core:core-ktx:1.2.0" implementation "androidx.annotation:annotation:1.1.0" implementation "com.google.android.material:material:1.1.0" implementation "androidx.constraintlayout:constraintlayout:1.1.3" } -apply plugin: "com.github.willir.rust.cargo-ndk-android" +apply plugin: "org.mozilla.rust-android-gradle.rust-android" -cargoNdk { +cargo { module = "." + libname = "tts" + targets = ["arm", "x86"] +} + +tasks.whenTaskAdded { task -> + if ((task.name == 'javaPreCompileDebug' || task.name == 'javaPreCompileRelease')) { + task.dependsOn "cargoBuild" + } } project.afterEvaluate { diff --git a/examples/android/app/src/main/AndroidManifest.xml b/examples/android/app/src/main/AndroidManifest.xml index 86dda62..d934c07 100644 --- a/examples/android/app/src/main/AndroidManifest.xml +++ b/examples/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ - + - + diff --git a/examples/android/build.gradle b/examples/android/build.gradle index 27b39c3..2c5b742 100644 --- a/examples/android/build.gradle +++ b/examples/android/build.gradle @@ -1,28 +1,28 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - ext.kotlin_version = "1.3.72" - repositories { - google() - jcenter() + +buildscript { + repositories { + google() + mavenCentral() maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { - classpath "com.android.tools.build:gradle:4.1.1" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "gradle.plugin.com.github.willir.rust:plugin:0.3.4" - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } + } +} + +plugins { + id "com.android.application" version "7.3.0" apply false + id "com.android.library" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.21" apply false + id "org.mozilla.rust-android-gradle.rust-android" version "0.9.3" apply false } allprojects { repositories { google() - jcenter() - } -} + mavenCentral() + } +} task clean(type: Delete) { delete rootProject.buildDir diff --git a/examples/android/cargo.toml b/examples/android/cargo.toml index 0b565e8..c0b85bc 100644 --- a/examples/android/cargo.toml +++ b/examples/android/cargo.toml @@ -10,5 +10,5 @@ edition = "2018" crate-type = ["dylib"] [dependencies] -ndk-glue = "0.6" +ndk-glue = "0.7" tts = { path = "../.." } \ No newline at end of file diff --git a/examples/android/gradle/wrapper/gradle-wrapper.properties b/examples/android/gradle/wrapper/gradle-wrapper.properties index 7b15717..f627ce0 100644 --- a/examples/android/gradle/wrapper/gradle-wrapper.properties +++ b/examples/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip diff --git a/examples/android/settings.gradle b/examples/android/settings.gradle index 1fb859b..9327e52 100644 --- a/examples/android/settings.gradle +++ b/examples/android/settings.gradle @@ -1 +1,8 @@ -include ":app" \ No newline at end of file +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +include ":app" diff --git a/src/backends/android.rs b/src/backends/android.rs index 3f6d422..cbbcee2 100644 --- a/src/backends/android.rs +++ b/src/backends/android.rs @@ -179,8 +179,9 @@ impl Android { let id = BackendId::Android(bid); *backend_id += 1; drop(backend_id); - let native_activity = ndk_glue::native_activity(); - let vm = Self::vm()?; + let ctx = ndk_context::android_context(); + let vm = unsafe { jni::JavaVM::from_raw(ctx.vm().cast()) }?; + let context = unsafe { JObject::from_raw(ctx.context().cast()) }; let env = vm.attach_current_thread_permanently()?; let bridge = BRIDGE.lock().unwrap(); if let Some(bridge) = &*bridge { @@ -188,7 +189,7 @@ impl Android { let tts = env.new_object( "android/speech/tts/TextToSpeech", "(Landroid/content/Context;Landroid/speech/tts/TextToSpeech$OnInitListener;)V", - &[native_activity.activity().into(), bridge.into()], + &[context.into(), bridge.into()], )?; env.call_method( tts, @@ -229,9 +230,8 @@ impl Android { } fn vm() -> Result { - let native_activity = ndk_glue::native_activity(); - let vm_ptr = native_activity.vm(); - unsafe { jni::JavaVM::from_raw(vm_ptr) } + let ctx = ndk_context::android_context(); + unsafe { jni::JavaVM::from_raw(ctx.vm().cast()) } } } From 3e4299d0e6c3cba45fa9aa48037b26c9b44783d5 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Nov 2022 11:04:05 -0600 Subject: [PATCH 2/9] Update some old actions to newer versions. --- .github/workflows/release.yml | 12 ++++++------ .github/workflows/test.yml | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc1b3b0..cbed250 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,8 +13,8 @@ jobs: os: [windows-latest, ubuntu-22.04, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 - run: sudo apt-get update; sudo apt-get install -y libspeechd-dev if: ${{ runner.os == 'Linux' }} - uses: actions-rs/toolchain@v1 @@ -52,8 +52,8 @@ jobs: name: Check Web runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/toolchain@v1 with: target: wasm32-unknown-unknown @@ -88,8 +88,8 @@ jobs: env: CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }} steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/toolchain@v1 with: target: wasm32-unknown-unknown diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 306cdc7..a1fb195 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,8 +12,8 @@ jobs: os: [windows-latest, ubuntu-22.04, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 - run: sudo apt-get update; sudo apt-get install -y libspeechd-dev if: ${{ runner.os == 'Linux' }} - uses: actions-rs/toolchain@v1 @@ -51,8 +51,8 @@ jobs: name: Check Web runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/toolchain@v1 with: target: wasm32-unknown-unknown @@ -77,8 +77,8 @@ jobs: name: Check Android runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -99,8 +99,8 @@ jobs: name: Check Web Example runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/toolchain@v1 with: target: wasm32-unknown-unknown From e19e5ef0b72368c92525df22b7128afb8ea1a21c Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Nov 2022 11:13:05 -0600 Subject: [PATCH 3/9] Remove unnecessary return statement. --- src/backends/web.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/web.rs b/src/backends/web.rs index 578a213..e2fb0c4 100644 --- a/src/backends/web.rs +++ b/src/backends/web.rs @@ -248,7 +248,7 @@ impl Backend for Web { return Ok(()); } } - return Err(Error::OperationFailed); + Err(Error::OperationFailed) } else { Err(Error::NoneError) } From 61d84a21200eaa04e10c7c6061a084e04e748312 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Nov 2022 12:12:57 -0600 Subject: [PATCH 4/9] Manually install toolchain before cache to eliminate a deprecated action and hopefully fix checksum validation failures. --- .github/workflows/release.yml | 22 +++------------------- .github/workflows/test.yml | 30 ++++-------------------------- 2 files changed, 7 insertions(+), 45 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cbed250..a28727d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,15 +14,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 + - run: rustup toolchain install stable - uses: Swatinem/rust-cache@v2 - run: sudo apt-get update; sudo apt-get install -y libspeechd-dev if: ${{ runner.os == 'Linux' }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - override: true - uses: actions-rs/cargo@v1 with: command: check @@ -53,14 +48,8 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 + - run: rustup toolchain install stable - uses: Swatinem/rust-cache@v2 - - uses: actions-rs/toolchain@v1 - with: - target: wasm32-unknown-unknown - profile: minimal - toolchain: stable - components: rustfmt, clippy - override: true - uses: actions-rs/cargo@v1 with: command: check @@ -89,13 +78,8 @@ jobs: CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }} steps: - uses: actions/checkout@v3 + - run: rustup toolchain install stable - uses: Swatinem/rust-cache@v2 - - uses: actions-rs/toolchain@v1 - with: - target: wasm32-unknown-unknown - profile: minimal - toolchain: stable - override: true - run: | sudo apt-get update sudo apt-get install -y libspeechd-dev diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1fb195..b76fdc8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,15 +13,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 + - run: rustup toolchain install stable - uses: Swatinem/rust-cache@v2 - run: sudo apt-get update; sudo apt-get install -y libspeechd-dev if: ${{ runner.os == 'Linux' }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - override: true - uses: actions-rs/cargo@v1 with: command: check @@ -52,14 +47,8 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 + - run: rustup toolchain install stable - uses: Swatinem/rust-cache@v2 - - uses: actions-rs/toolchain@v1 - with: - target: wasm32-unknown-unknown - profile: minimal - toolchain: stable - components: rustfmt, clippy - override: true - uses: actions-rs/cargo@v1 with: command: check @@ -78,13 +67,8 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 + - run: rustup toolchain install stable - uses: Swatinem/rust-cache@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - override: true - uses: actions-rs/install@v0.1 with: crate: cargo-apk @@ -100,14 +84,8 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 + - run: rustup toolchain install stable - uses: Swatinem/rust-cache@v2 - - uses: actions-rs/toolchain@v1 - with: - target: wasm32-unknown-unknown - profile: minimal - toolchain: stable - components: rustfmt, clippy - override: true - uses: actions-rs/install@v0.1 with: crate: cargo-make From 6770a2ed58953101e4e93c6bbe47398fdb2e5f24 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Nov 2022 12:27:40 -0600 Subject: [PATCH 5/9] Eliminate caching. --- .github/workflows/test.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b76fdc8..dd75a69 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,10 +13,9 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - run: rustup toolchain install stable - - uses: Swatinem/rust-cache@v2 - run: sudo apt-get update; sudo apt-get install -y libspeechd-dev if: ${{ runner.os == 'Linux' }} + - run: rustup toolchain install stable - uses: actions-rs/cargo@v1 with: command: check @@ -48,7 +47,6 @@ jobs: steps: - uses: actions/checkout@v3 - run: rustup toolchain install stable - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: check @@ -67,13 +65,13 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - run: rustup toolchain install stable - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/install@v0.1 with: crate: cargo-apk # use-tool-cache: true - - run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android + - run: | + rustup toolchain install stable + rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android - uses: actions-rs/cargo@v1 with: command: apk @@ -85,7 +83,6 @@ jobs: steps: - uses: actions/checkout@v3 - run: rustup toolchain install stable - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/install@v0.1 with: crate: cargo-make From 5470b9557df0e34470ef0fd6cc248bfd1d11a689 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Nov 2022 12:36:00 -0600 Subject: [PATCH 6/9] Drop old actions-rs actions which seem to no longer be updated. --- .github/workflows/test.yml | 70 +++++++++----------------------------- 1 file changed, 16 insertions(+), 54 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd75a69..2c067e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,78 +15,40 @@ jobs: - uses: actions/checkout@v3 - run: sudo apt-get update; sudo apt-get install -y libspeechd-dev if: ${{ runner.os == 'Linux' }} - - run: rustup toolchain install stable - - uses: actions-rs/cargo@v1 - with: - command: check - args: --all-features --examples - if: ${{ runner.os != 'Linux' }} - - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features --examples - if: ${{ runner.os == 'Linux' }} - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all --check - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features - if: ${{ runner.os != 'Linux' }} - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --no-default-features - if: ${{ runner.os == 'Linux' }} + - run: | + rustup toolchain install stable + cargo check --all-features --examples + cargo fmt --all --check + cargo clippy --all-features check_web: name: Check Web runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - run: rustup toolchain install stable - - uses: actions-rs/cargo@v1 - with: - command: check - args: --all-features --examples --target wasm32-unknown-unknown - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all --check - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features --target wasm32-unknown-unknown + - run: | + rustup toolchain install stable + cargo check --all-features --examples --target wasm32-unknown-unknown + cargo fmt --all --check + cargo clippy --all-features --target wasm32-unknown-unknown check_android: name: Check Android runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - uses: actions-rs/install@v0.1 - with: - crate: cargo-apk - # use-tool-cache: true - run: | rustup toolchain install stable rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android - - uses: actions-rs/cargo@v1 - with: - command: apk - args: build + cargo install -f cargo-apk + cargo apk build check_web_example: name: Check Web Example runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - run: rustup toolchain install stable - - uses: actions-rs/install@v0.1 - with: - crate: cargo-make - - uses: actions-rs/cargo@v1 - with: - command: make - args: build-web-example + - run: | + rustup toolchain install stable + cargo install cargo-make + cargo make build-web-example From 3c9a78a953b083bfaedfa39888c5e3aef31a992f Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Nov 2022 12:44:43 -0600 Subject: [PATCH 7/9] Install necessary targets and simplify further. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c067e6..75eb60f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,6 @@ jobs: if: ${{ runner.os == 'Linux' }} - run: | rustup toolchain install stable - cargo check --all-features --examples cargo fmt --all --check cargo clippy --all-features @@ -28,7 +27,7 @@ jobs: - uses: actions/checkout@v3 - run: | rustup toolchain install stable - cargo check --all-features --examples --target wasm32-unknown-unknown + rustup target add wasm32-unknown-unknown cargo fmt --all --check cargo clippy --all-features --target wasm32-unknown-unknown @@ -50,5 +49,6 @@ jobs: - uses: actions/checkout@v3 - run: | rustup toolchain install stable + rustup target add wasm32-unknown-unknown cargo install cargo-make cargo make build-web-example From 8102820f864c361026bdaaef2e0db280ec0e4b64 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Nov 2022 14:13:46 -0600 Subject: [PATCH 8/9] These checks should be run before the tag is pushed, so remove them from the release workflow. --- .github/workflows/release.yml | 70 +---------------------------------- 1 file changed, 2 insertions(+), 68 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a28727d..6579d70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,82 +6,16 @@ on: - "v*" jobs: - check: - name: Check - strategy: - matrix: - os: [windows-latest, ubuntu-22.04, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - run: rustup toolchain install stable - - uses: Swatinem/rust-cache@v2 - - run: sudo apt-get update; sudo apt-get install -y libspeechd-dev - if: ${{ runner.os == 'Linux' }} - - uses: actions-rs/cargo@v1 - with: - command: check - args: --all-features --examples - if: ${{ runner.os != 'Linux' }} - - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features --examples - if: ${{ runner.os == 'Linux' }} - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all --check - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features - if: ${{ runner.os != 'Linux' }} - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --no-default-features - if: ${{ runner.os == 'Linux' }} - - check_web: - name: Check Web - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - run: rustup toolchain install stable - - uses: Swatinem/rust-cache@v2 - - uses: actions-rs/cargo@v1 - with: - command: check - args: --all-features --examples --target wasm32-unknown-unknown - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features --target wasm32-unknown-unknown - - uses: actions-rs/install@v0.1 - with: - crate: cargo-make - - uses: actions-rs/cargo@v1 - with: - command: make - args: build-web-example - publish: name: Publish runs-on: ubuntu-22.04 - needs: [check, check_web] env: CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }} steps: - uses: actions/checkout@v3 - - run: rustup toolchain install stable - - uses: Swatinem/rust-cache@v2 - run: | sudo apt-get update sudo apt-get install -y libspeechd-dev cargo login $CARGO_TOKEN - cargo publish --no-default-features + rustup toolchain install stable + cargo publish From f6766ec6335f711830d9513c20bb2c227edc36b1 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Nov 2022 14:15:40 -0600 Subject: [PATCH 9/9] Bump speech-dispatcher dependency and tweak docs.rs build configuration. --- Cargo.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 30a5e1b..13f4576 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ edition = "2021" crate-type = ["lib", "cdylib", "staticlib"] [features] +speech_dispatcher_0_9 = ["speech-dispatcher/0_9"] speech_dispatcher_0_10 = ["speech-dispatcher/0_10"] speech_dispatcher_0_11 = ["speech-dispatcher/0_11"] default = ["speech_dispatcher_0_11"] @@ -32,7 +33,7 @@ tolk = { version = "0.5", optional = true } windows = { version = "0.42", features = ["Foundation", "Foundation_Collections", "Media_Core", "Media_Playback", "Media_SpeechSynthesis", "Storage_Streams"] } [target.'cfg(target_os = "linux")'.dependencies] -speech-dispatcher = { version = "0.15", default-features = false } +speech-dispatcher = { version = "0.16", default-features = false } [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies] cocoa-foundation = "0.1" @@ -50,4 +51,5 @@ ndk-context = "0.1" ndk-glue = "0.7" [package.metadata.docs.rs] -no-default-features = true \ No newline at end of file +no-default-features = true +features = ["speech_dispatcher_0_9"] \ No newline at end of file