mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-29 14:04:19 +03:00
refactor(android): use tauri.settings.gradle and tauri.build.gradle.kts to define tauri plugins (#6217)
This commit is contained in:
parent
a81750d779
commit
481d9de739
@ -74,14 +74,11 @@ project(':{pkg_name}').projectDir = new File('./tauri-plugins/{pkg_name}')"
|
||||
|
||||
let app_build_gradle = fs::read_to_string(&app_build_gradle_path)?;
|
||||
let implementation = format!(r#"implementation(project(":{pkg_name}"))"#);
|
||||
let target_implementation = r#"implementation(project(":tauri-android"))"#;
|
||||
let target = "dependencies {";
|
||||
if !app_build_gradle.contains(&implementation) {
|
||||
fs::write(
|
||||
&app_build_gradle_path,
|
||||
app_build_gradle.replace(
|
||||
target_implementation,
|
||||
&format!("{target_implementation}\n {implementation}"),
|
||||
),
|
||||
app_build_gradle.replace(target, &format!("{target}\n {implementation}")),
|
||||
)?
|
||||
}
|
||||
}
|
||||
|
@ -140,11 +140,14 @@ pub fn get_config(
|
||||
set_var("TAURI_PLUGIN_OUTPUT_PATH", plugin_output_path);
|
||||
set_var(
|
||||
"TAURI_GRADLE_SETTINGS_PATH",
|
||||
config.project_dir().join("settings.gradle"),
|
||||
config.project_dir().join("tauri.settings.gradle"),
|
||||
);
|
||||
set_var(
|
||||
"TAURI_APP_GRADLE_BUILD_PATH",
|
||||
config.project_dir().join("app").join("build.gradle.kts"),
|
||||
config
|
||||
.project_dir()
|
||||
.join("app")
|
||||
.join("tauri.build.gradle.kts"),
|
||||
);
|
||||
|
||||
(app, config, metadata)
|
||||
|
@ -89,6 +89,8 @@ dependencies {
|
||||
implementation(project(":tauri-android"))
|
||||
}
|
||||
|
||||
apply(from = "tauri.build.gradle.kts")
|
||||
|
||||
afterEvaluate {
|
||||
android.applicationVariants.all {
|
||||
tasks["mergeUniversalReleaseJniLibFolders"].dependsOn(tasks["rustBuildRelease"])
|
||||
|
@ -0,0 +1,7 @@
|
||||
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|
||||
val implementation by configurations
|
||||
|
||||
dependencies {
|
||||
|
||||
}
|
@ -4,3 +4,5 @@ include ':{{this}}'{{/each}}
|
||||
|
||||
include ':tauri-android'
|
||||
project(':tauri-android').projectDir = new File('./tauri-api')
|
||||
|
||||
apply from: 'tauri.settings.gradle'
|
||||
|
@ -0,0 +1 @@
|
||||
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
Loading…
Reference in New Issue
Block a user