|
5 | 5 | use std::{ |
6 | 6 | collections::HashMap, |
7 | 7 | env::{var, var_os}, |
8 | | - fs::{copy, create_dir, create_dir_all, read_to_string, remove_dir_all, rename, write}, |
| 8 | + fs::{copy, create_dir, create_dir_all, read_to_string, remove_dir_all, write}, |
9 | 9 | path::{Path, PathBuf}, |
10 | 10 | }; |
11 | 11 |
|
@@ -127,45 +127,6 @@ pub fn link_swift_library(name: &str, source: impl AsRef<Path>) { |
127 | 127 | } |
128 | 128 | } |
129 | 129 |
|
130 | | -#[doc(hidden)] |
131 | | -pub fn inject_android_project( |
132 | | - source: impl AsRef<Path>, |
133 | | - target: impl AsRef<Path>, |
134 | | - ignore_paths: &[&str], |
135 | | -) -> Result<()> { |
136 | | - let source = source.as_ref(); |
137 | | - let target = target.as_ref(); |
138 | | - |
139 | | - // keep build folder if it exists |
140 | | - let build_path = target.join("build"); |
141 | | - let out_dir = if build_path.exists() { |
142 | | - let out_dir = target.parent().unwrap().join(".tauri-tmp-build"); |
143 | | - let _ = remove_dir_all(&out_dir); |
144 | | - rename(&build_path, &out_dir).context("failed to rename build directory")?; |
145 | | - Some(out_dir) |
146 | | - } else { |
147 | | - None |
148 | | - }; |
149 | | - |
150 | | - copy_folder(source, target, ignore_paths).context("failed to copy Android project")?; |
151 | | - |
152 | | - if let Some(out_dir) = out_dir { |
153 | | - rename(out_dir, &build_path).context("failed to restore build directory")?; |
154 | | - } |
155 | | - |
156 | | - let rerun_path = target.join("build.gradle.kts"); |
157 | | - let metadata = source.join("build.gradle.kts").metadata()?; |
158 | | - filetime::set_file_mtime( |
159 | | - &rerun_path, |
160 | | - filetime::FileTime::from_last_modification_time(&metadata), |
161 | | - ) |
162 | | - .context("failed to update build.gradle.kts mtime")?; |
163 | | - |
164 | | - println!("cargo:rerun-if-changed={}", rerun_path.display()); |
165 | | - |
166 | | - Ok(()) |
167 | | -} |
168 | | - |
169 | 130 | fn copy_folder(source: &Path, target: &Path, ignore_paths: &[&str]) -> Result<()> { |
170 | 131 | let _ = remove_dir_all(target); |
171 | 132 |
|
|
0 commit comments