Skip to content

Commit

Permalink
use patched tauri-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed May 22, 2024
1 parent 391297f commit 70b9919
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ jobs:
if: startsWith(matrix.target, 'android')
shell: bash
run: |
# TODO: Remove this once patches are merged
cargo install --git https://github.com/mariotaku/tauri.git --branch devman tauri-cli
npm run tauri android init
npm run tauri android build -- --aab
if [ -n "$AAB_SIGNING_KEYSTORE" ]; then
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ members = [
[patch.crates-io]
cc = { git = "https://github.com/mariotaku/cc-rs.git", rev = "01a3414" }
r2d2 = { git = "https://github.com/mariotaku/r2d2.git", rev = "aaa2a2b" }
# TODO: remove this patch when this branch is merged
tauri-build = { git = "https://github.com/mariotaku/tauri.git", branch = "feature/android-version-info" }
22 changes: 21 additions & 1 deletion scripts/tauri-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,28 @@ async function run() {
if (process.platform === 'win32' && process.argv[2] === 'android') {
await prepareOpenSSL();
}
const hasCargoTauri = await (new Promise((resolve, reject) => {
child_process.exec('cargo tauri -V', (err, stdout) => {
if (err) {
reject(new Error('Tauri is not installed'));
} else {
resolve();
}
});
}).then(() => true).catch(() => false));
if (hasCargoTauri) {
return new Promise((resolve, reject) => {
const child = child_process.spawn('cargo', ['tauri', ...process.argv.slice(2)], {stdio: 'inherit'});
child.on('exit', (code) => {
if (code === 0) {
resolve();
} else {
reject(new Error(`Tauri CLI exited with code ${code}`));
}
});
});
}
await cli.run(process.argv.slice(2), null);

}

run().then(async () => {
Expand Down

0 comments on commit 70b9919

Please sign in to comment.