chore(deps): update tauri and Android project (#360)

pull/361/head
Lucas Fernandes Nogueira 2 years ago committed by GitHub
parent 702b7b36bd
commit d87b569643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

14
Cargo.lock generated

@ -4960,7 +4960,7 @@ dependencies = [
[[package]] [[package]]
name = "tauri" name = "tauri"
version = "2.0.0-alpha.8" version = "2.0.0-alpha.8"
source = "git+https://github.com/tauri-apps/tauri?branch=next#6d25c4d07fcf18c2a19ac4faa7d9bedd96d1a75f" source = "git+https://github.com/tauri-apps/tauri?branch=next#59db76af4c88645ee03b9f87c0f787fbc0040905"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes 1.4.0", "bytes 1.4.0",
@ -5010,7 +5010,7 @@ dependencies = [
[[package]] [[package]]
name = "tauri-build" name = "tauri-build"
version = "2.0.0-alpha.4" version = "2.0.0-alpha.4"
source = "git+https://github.com/tauri-apps/tauri?branch=next#6d25c4d07fcf18c2a19ac4faa7d9bedd96d1a75f" source = "git+https://github.com/tauri-apps/tauri?branch=next#59db76af4c88645ee03b9f87c0f787fbc0040905"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cargo_toml", "cargo_toml",
@ -5030,7 +5030,7 @@ dependencies = [
[[package]] [[package]]
name = "tauri-codegen" name = "tauri-codegen"
version = "2.0.0-alpha.4" version = "2.0.0-alpha.4"
source = "git+https://github.com/tauri-apps/tauri?branch=next#6d25c4d07fcf18c2a19ac4faa7d9bedd96d1a75f" source = "git+https://github.com/tauri-apps/tauri?branch=next#59db76af4c88645ee03b9f87c0f787fbc0040905"
dependencies = [ dependencies = [
"base64 0.21.0", "base64 0.21.0",
"brotli", "brotli",
@ -5055,7 +5055,7 @@ dependencies = [
[[package]] [[package]]
name = "tauri-macros" name = "tauri-macros"
version = "2.0.0-alpha.4" version = "2.0.0-alpha.4"
source = "git+https://github.com/tauri-apps/tauri?branch=next#6d25c4d07fcf18c2a19ac4faa7d9bedd96d1a75f" source = "git+https://github.com/tauri-apps/tauri?branch=next#59db76af4c88645ee03b9f87c0f787fbc0040905"
dependencies = [ dependencies = [
"heck 0.4.1", "heck 0.4.1",
"proc-macro2", "proc-macro2",
@ -5449,7 +5449,7 @@ dependencies = [
[[package]] [[package]]
name = "tauri-runtime" name = "tauri-runtime"
version = "0.13.0-alpha.4" version = "0.13.0-alpha.4"
source = "git+https://github.com/tauri-apps/tauri?branch=next#6d25c4d07fcf18c2a19ac4faa7d9bedd96d1a75f" source = "git+https://github.com/tauri-apps/tauri?branch=next#59db76af4c88645ee03b9f87c0f787fbc0040905"
dependencies = [ dependencies = [
"gtk", "gtk",
"http", "http",
@ -5469,7 +5469,7 @@ dependencies = [
[[package]] [[package]]
name = "tauri-runtime-wry" name = "tauri-runtime-wry"
version = "0.13.0-alpha.4" version = "0.13.0-alpha.4"
source = "git+https://github.com/tauri-apps/tauri?branch=next#6d25c4d07fcf18c2a19ac4faa7d9bedd96d1a75f" source = "git+https://github.com/tauri-apps/tauri?branch=next#59db76af4c88645ee03b9f87c0f787fbc0040905"
dependencies = [ dependencies = [
"cocoa", "cocoa",
"gtk", "gtk",
@ -5489,7 +5489,7 @@ dependencies = [
[[package]] [[package]]
name = "tauri-utils" name = "tauri-utils"
version = "2.0.0-alpha.4" version = "2.0.0-alpha.4"
source = "git+https://github.com/tauri-apps/tauri?branch=next#6d25c4d07fcf18c2a19ac4faa7d9bedd96d1a75f" source = "git+https://github.com/tauri-apps/tauri?branch=next#59db76af4c88645ee03b9f87c0f787fbc0040905"
dependencies = [ dependencies = [
"aes-gcm 0.10.1", "aes-gcm 0.10.1",
"brotli", "brotli",

@ -27,7 +27,6 @@ tauri-plugin-notification = { path = "../../../plugins/notification", features =
tauri-plugin-os = { path = "../../../plugins/os" } tauri-plugin-os = { path = "../../../plugins/os" }
tauri-plugin-process = { path = "../../../plugins/process" } tauri-plugin-process = { path = "../../../plugins/process" }
tauri-plugin-shell = { path = "../../../plugins/shell" } tauri-plugin-shell = { path = "../../../plugins/shell" }
tauri-plugin-updater = { path = "../../../plugins/updater" }
tauri-plugin-window = { path = "../../../plugins/window" } tauri-plugin-window = { path = "../../../plugins/window" }
[dependencies.tauri] [dependencies.tauri]
@ -44,6 +43,7 @@ features = [
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
tauri-plugin-cli = { path = "../../../plugins/cli" } tauri-plugin-cli = { path = "../../../plugins/cli" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut" } tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut" }
tauri-plugin-updater = { path = "../../../plugins/updater" }
[target."cfg(target_os = \"windows\")".dependencies] [target."cfg(target_os = \"windows\")".dependencies]
window-shadows = "0.2" window-shadows = "0.2"

@ -13,6 +13,7 @@ build
.externalNativeBuild .externalNativeBuild
.cxx .cxx
local.properties local.properties
key.properties
/.tauri /.tauri
/tauri.settings.gradle /tauri.settings.gradle

@ -1,113 +0,0 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("rustPlugin")
}
android {
compileSdk = 33
defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "com.tauri.api"
minSdk = 24
targetSdk = 33
versionCode = 1
versionName = "1.0"
}
sourceSets.getByName("main") {
// Vulkan validation layers
val ndkHome = System.getenv("NDK_HOME")
jniLibs.srcDir("${ndkHome}/sources/third_party/vulkan/src/build-android/jniLibs")
}
buildTypes {
getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true"
isDebuggable = true
isJniDebuggable = true
isMinifyEnabled = false
packagingOptions { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
jniLibs.keepDebugSymbols.add("*/x86/*.so")
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
}
}
getByName("release") {
isMinifyEnabled = true
val proguards = fileTree(".") {
include("*.pro")
}
proguardFiles(*proguards.toList().toTypedArray())
}
}
flavorDimensions.add("abi")
productFlavors {
create("universal") {
dimension = "abi"
ndk {
abiFilters += (findProperty("abiList") as? String)?.split(",") ?: listOf( "arm64-v8a", "armeabi-v7a", "x86", "x86_64",
)
}
}
create("arm64") {
dimension = "abi"
ndk {
abiFilters += listOf("arm64-v8a")
}
}
create("arm") {
dimension = "abi"
ndk {
abiFilters += listOf("armeabi-v7a")
}
}
create("x86") {
dimension = "abi"
ndk {
abiFilters += listOf("x86")
}
}
create("x86_64") {
dimension = "abi"
ndk {
abiFilters += listOf("x86_64")
}
}
}
assetPacks += mutableSetOf()
namespace = "com.tauri.api"
}
rust {
rootDirRel = "../../../../"
targets = (findProperty("targetList") as? String)?.split(",") ?: listOf("aarch64", "armv7", "i686", "x86_64")
arches = (findProperty("archList") as? String)?.split(",") ?: listOf("arm64", "arm", "x86", "x86_64")
}
dependencies {
implementation("androidx.webkit:webkit:1.5.0")
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("com.google.android.material:material:1.7.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
implementation(project(":tauri-android"))
}
apply(from = "tauri.build.gradle.kts")
afterEvaluate {
android.applicationVariants.all {
tasks["mergeUniversalReleaseJniLibFolders"].dependsOn(tasks["rustBuildRelease"])
tasks["mergeUniversalDebugJniLibFolders"].dependsOn(tasks["rustBuildDebug"])
if (findProperty("targetList") == null) {
productFlavors.filter{ it.name != "universal" }.forEach { _ ->
val archAndBuildType = name.capitalize()
tasks["merge${archAndBuildType}JniLibFolders"].dependsOn(tasks["rustBuild${archAndBuildType}"])
}
}
}
}

@ -1,7 +0,0 @@
package com.tauri.api
import app.tauri.plugin.PluginManager
class MainActivity : TauriActivity() {
var pluginManager: PluginManager = PluginManager(this)
}

@ -1,59 +0,0 @@
package com.tauri
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import java.io.File
import java.util.*
const val TASK_GROUP = "rust"
open class Config {
var rootDirRel: String? = null
var targets: List<String>? = null
var arches: List<String>? = null
}
open class RustPlugin : Plugin<Project> {
private lateinit var config: Config
override fun apply(project: Project) {
config = project.extensions.create("rust", Config::class.java)
project.afterEvaluate {
if (config.targets == null) {
throw GradleException("targets cannot be null")
}
if (config.arches == null) {
throw GradleException("arches cannot be null")
}
for (profile in listOf("debug", "release")) {
val profileCapitalized = profile.capitalize(Locale.ROOT)
val buildTask = project.tasks.maybeCreate(
"rustBuild$profileCapitalized",
DefaultTask::class.java
).apply {
group = TASK_GROUP
description = "Build dynamic library in $profile mode for all targets"
}
for (targetPair in config.targets!!.withIndex()) {
val targetName = targetPair.value
val targetArch = config.arches!![targetPair.index]
val targetArchCapitalized = targetArch.capitalize(Locale.ROOT)
val targetBuildTask = project.tasks.maybeCreate(
"rustBuild$targetArchCapitalized$profileCapitalized",
BuildTask::class.java
).apply {
group = TASK_GROUP
description = "Build dynamic library in $profile mode for $targetArch"
rootDirRel = config.rootDirRel?.let { File(it) }
target = targetName
release = profile == "release"
}
buildTask.dependsOn(targetBuildTask)
project.tasks.findByName("preBuild")?.mustRunAfter(targetBuildTask)
}
}
}
}
}

@ -1,6 +0,0 @@
include ':app'
include ':tauri-android'
project(':tauri-android').projectDir = new File('./.tauri/tauri-api')
apply from: 'tauri.settings.gradle'

@ -1,4 +1,5 @@
/src/main/java/com/tauri/api/generated /src/main/java/com/tauri/api/generated
/src/main/jniLibs/**/*.so /src/main/jniLibs/**/*.so
/src/main/assets/tauri.conf.json
/tauri.build.gradle.kts /tauri.build.gradle.kts
/proguard-tauri.pro /proguard-tauri.pro

@ -0,0 +1,57 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("rust")
}
android {
compileSdk = 33
namespace = "com.tauri.api"
defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "com.tauri.api"
minSdk = 24
targetSdk = 33
versionCode = 1
versionName = "1.0"
}
buildTypes {
getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true"
isDebuggable = true
isJniDebuggable = true
isMinifyEnabled = false
packaging { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
jniLibs.keepDebugSymbols.add("*/x86/*.so")
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
}
}
getByName("release") {
isMinifyEnabled = true
proguardFiles(
*fileTree(".") { include("**/*.pro") }
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
.toList().toTypedArray()
)
}
}
kotlinOptions {
jvmTarget = "1.8"
}
}
rust {
rootDirRel = "../../../"
}
dependencies {
implementation("androidx.webkit:webkit:1.6.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.8.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
}
apply(from = "tauri.build.gradle.kts")

@ -14,7 +14,6 @@
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>

@ -0,0 +1,3 @@
package com.tauri.api
class MainActivity : TauriActivity()

@ -1,14 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:7.3.1") classpath("com.android.tools.build:gradle:8.0.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
} }

@ -5,8 +5,8 @@ plugins {
gradlePlugin { gradlePlugin {
plugins { plugins {
create("pluginsForCoolKids") { create("pluginsForCoolKids") {
id = "rustPlugin" id = "rust"
implementationClass = "com.tauri.RustPlugin" implementationClass = "RustPlugin"
} }
} }
} }
@ -18,6 +18,6 @@ repositories {
dependencies { dependencies {
compileOnly(gradleApi()) compileOnly(gradleApi())
implementation("com.android.tools.build:gradle:7.3.1") implementation("com.android.tools.build:gradle:8.0.0")
} }

@ -1,28 +1,22 @@
package com.tauri
import java.io.File import java.io.File
import org.apache.tools.ant.taskdefs.condition.Os import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.DefaultTask import org.gradle.api.DefaultTask
import org.gradle.api.GradleException import org.gradle.api.GradleException
import org.gradle.api.logging.LogLevel import org.gradle.api.logging.LogLevel
import org.gradle.api.tasks.Input import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.TaskAction
open class BuildTask : DefaultTask() { open class BuildTask : DefaultTask() {
@InputDirectory @Input
@PathSensitive(PathSensitivity.RELATIVE) var rootDirRel: String? = null
var rootDirRel: File? = null
@Input @Input
var target: String? = null var target: String? = null
@Input @Input
var release: Boolean? = null var release: Boolean? = null
@TaskAction @TaskAction
fun build() { fun assemble() {
val executable = """yarn"""; val executable = """pnpm""";
try { try {
runTauriCli(executable) runTauriCli(executable)
} catch (e: Exception) { } catch (e: Exception) {
@ -41,7 +35,7 @@ open class BuildTask : DefaultTask() {
val args = listOf("tauri", "android", "android-studio-script"); val args = listOf("tauri", "android", "android-studio-script");
project.exec { project.exec {
workingDir(File(project.projectDir, rootDirRel.path)) workingDir(File(project.projectDir, rootDirRel))
executable(executable) executable(executable)
args(args) args(args)
if (project.logger.isEnabled(LogLevel.DEBUG)) { if (project.logger.isEnabled(LogLevel.DEBUG)) {

@ -0,0 +1,85 @@
import com.android.build.api.dsl.ApplicationExtension
import org.gradle.api.DefaultTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.get
const val TASK_GROUP = "rust"
open class Config {
lateinit var rootDirRel: String
}
open class RustPlugin : Plugin<Project> {
private lateinit var config: Config
override fun apply(project: Project) = with(project) {
config = extensions.create("rust", Config::class.java)
val defaultAbiList = listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64");
val abiList = (findProperty("abiList") as? String)?.split(',') ?: defaultAbiList
val defaultArchList = listOf("arm64", "arm", "x86", "x86_64");
val archList = (findProperty("archList") as? String)?.split(',') ?: listOf("arm64", "arm", "x86", "x86_64")
val targetsList = (findProperty("targetList") as? String)?.split(',') ?: listOf("aarch64", "armv7", "i686", "x86_64")
extensions.configure<ApplicationExtension> {
@Suppress("UnstableApiUsage")
flavorDimensions.add("abi")
productFlavors {
create("universal") {
dimension = "abi"
ndk {
abiFilters += abiList
}
}
defaultArchList.forEachIndexed { index, arch ->
create(arch) {
dimension = "abi"
ndk {
abiFilters.add(defaultAbiList[index])
}
}
}
}
}
afterEvaluate {
for (profile in listOf("debug", "release")) {
val profileCapitalized = profile.replaceFirstChar { it.uppercase() }
val buildTask = tasks.maybeCreate(
"rustBuildUniversal$profileCapitalized",
DefaultTask::class.java
).apply {
group = TASK_GROUP
description = "Build dynamic library in $profile mode for all targets"
}
tasks["mergeUniversal${profileCapitalized}JniLibFolders"].dependsOn(buildTask)
for (targetPair in targetsList.withIndex()) {
val targetName = targetPair.value
val targetArch = archList[targetPair.index]
val targetArchCapitalized = targetArch.replaceFirstChar { it.uppercase() }
val targetBuildTask = project.tasks.maybeCreate(
"rustBuild$targetArchCapitalized$profileCapitalized",
BuildTask::class.java
).apply {
group = TASK_GROUP
description = "Build dynamic library in $profile mode for $targetArch"
rootDirRel = config.rootDirRel
target = targetName
release = profile == "release"
}
buildTask.dependsOn(targetBuildTask)
tasks["merge$targetArchCapitalized${profileCapitalized}JniLibFolders"].dependsOn(
targetBuildTask
)
}
}
}
}
}

@ -20,4 +20,6 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the # Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies, # resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library # thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false

@ -1,6 +1,6 @@
#Tue May 10 19:22:52 CST 2022 #Tue May 10 19:22:52 CST 2022
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

@ -0,0 +1,3 @@
include ':app'
apply from: 'tauri.settings.gradle'

@ -40,7 +40,6 @@ pub fn run() {
.plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_process::init()) .plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_window::init()) .plugin(tauri_plugin_window::init())
.setup(move |app| { .setup(move |app| {
#[cfg(desktop)] #[cfg(desktop)]
@ -49,6 +48,8 @@ pub fn run() {
app.handle().plugin(tauri_plugin_cli::init())?; app.handle().plugin(tauri_plugin_cli::init())?;
app.handle() app.handle()
.plugin(tauri_plugin_global_shortcut::Builder::new().build())?; .plugin(tauri_plugin_global_shortcut::Builder::new().build())?;
app.handle()
.plugin(tauri_plugin_updater::Builder::new().build())?;
} }
let mut window_builder = WindowBuilder::new(app, "main", WindowUrl::default()); let mut window_builder = WindowBuilder::new(app, "main", WindowUrl::default());

@ -4,6 +4,7 @@ version = "0.0.0"
edition.workspace = true edition.workspace = true
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
links = "tauri-plugin-clipboard"
[build-dependencies] [build-dependencies]
tauri-build.workspace = true tauri-build.workspace = true

@ -4,6 +4,7 @@ version = "0.0.0"
edition.workspace = true edition.workspace = true
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
links = "tauri-plugin-dialog"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true edition.workspace = true
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
links = "tauri-plugin-notification"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="app.tauri.notification">
<application> <application>
<receiver android:name="app.tauri.notification.TimedNotificationPublisher" /> <receiver android:name="app.tauri.notification.TimedNotificationPublisher" />

@ -0,0 +1,14 @@
fn main() {
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let mobile = target_os == "ios" || target_os == "android";
alias("desktop", !mobile);
alias("mobile", mobile);
}
// creates a cfg alias if `has_feature` is true.
// `alias` must be a snake case string.
fn alias(alias: &str, has_feature: bool) {
if has_feature {
println!("cargo:rustc-cfg={alias}");
}
}

@ -3,63 +3,77 @@ use tauri::{
Runtime, Runtime,
}; };
mod commands; #[cfg(desktop)]
mod desktop_commands;
pub fn init<R: Runtime>() -> TauriPlugin<R> { pub fn init<R: Runtime>() -> TauriPlugin<R> {
Builder::new("window") Builder::new("window")
.invoke_handler(tauri::generate_handler![ .invoke_handler(|invoke| {
commands::create, #[cfg(desktop)]
// getters {
commands::scale_factor, let handler: Box<dyn Fn(tauri::Invoke<R>) -> bool> =
commands::inner_position, Box::new(tauri::generate_handler![
commands::outer_position, desktop_commands::create,
commands::inner_size, // getters
commands::outer_size, desktop_commands::scale_factor,
commands::is_fullscreen, desktop_commands::inner_position,
commands::is_minimized, desktop_commands::outer_position,
commands::is_maximized, desktop_commands::inner_size,
commands::is_decorated, desktop_commands::outer_size,
commands::is_resizable, desktop_commands::is_fullscreen,
commands::is_visible, desktop_commands::is_minimized,
commands::title, desktop_commands::is_maximized,
commands::current_monitor, desktop_commands::is_decorated,
commands::primary_monitor, desktop_commands::is_resizable,
commands::available_monitors, desktop_commands::is_visible,
commands::theme, desktop_commands::title,
// setters desktop_commands::current_monitor,
commands::center, desktop_commands::primary_monitor,
commands::request_user_attention, desktop_commands::available_monitors,
commands::set_resizable, desktop_commands::theme,
commands::set_title, // setters
commands::maximize, desktop_commands::center,
commands::unmaximize, desktop_commands::request_user_attention,
commands::minimize, desktop_commands::set_resizable,
commands::unminimize, desktop_commands::set_title,
commands::show, desktop_commands::maximize,
commands::hide, desktop_commands::unmaximize,
commands::close, desktop_commands::minimize,
commands::set_decorations, desktop_commands::unminimize,
commands::set_shadow, desktop_commands::show,
commands::set_always_on_top, desktop_commands::hide,
commands::set_content_protected, desktop_commands::close,
commands::set_size, desktop_commands::set_decorations,
commands::set_min_size, desktop_commands::set_shadow,
commands::set_max_size, desktop_commands::set_always_on_top,
commands::set_position, desktop_commands::set_content_protected,
commands::set_fullscreen, desktop_commands::set_size,
commands::set_focus, desktop_commands::set_min_size,
commands::set_skip_taskbar, desktop_commands::set_max_size,
commands::set_cursor_grab, desktop_commands::set_position,
commands::set_cursor_visible, desktop_commands::set_fullscreen,
commands::set_cursor_icon, desktop_commands::set_focus,
commands::set_cursor_position, desktop_commands::set_skip_taskbar,
commands::set_ignore_cursor_events, desktop_commands::set_cursor_grab,
commands::start_dragging, desktop_commands::set_cursor_visible,
commands::print, desktop_commands::set_cursor_icon,
commands::set_icon, desktop_commands::set_cursor_position,
commands::toggle_maximize, desktop_commands::set_ignore_cursor_events,
commands::internal_toggle_maximize, desktop_commands::start_dragging,
commands::internal_toggle_devtools, desktop_commands::print,
]) desktop_commands::set_icon,
desktop_commands::toggle_maximize,
desktop_commands::internal_toggle_maximize,
desktop_commands::internal_toggle_devtools,
]);
#[allow(clippy::needless_return)]
return handler(invoke);
}
#[cfg(mobile)]
{
invoke.resolver.reject("Window API not available on mobile");
return true;
}
})
.build() .build()
} }

@ -4,6 +4,7 @@ version = "0.0.0"
edition.workspace = true edition.workspace = true
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
links = "tauri-plugin-{{name}}"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Loading…
Cancel
Save