diff --git a/src/recipes.jl b/src/recipes.jl index 216a527..e5a74d9 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -140,6 +140,11 @@ function bundle_app(platform::Windows, source, destination; with_splash_screen=n copy_app(source, "$app_dir/$app_name") ensure_windows_compatability(app_dir; path_length_threshold, skip_long_paths) + ensure_track_content("$app_dir/packages") # workaround until release with trcack_content patch is available + + if debug + touch(joinpath(app_dir, "debug")) + end if compress @info "Compressing into a zip archive" diff --git a/src/utils.jl b/src/utils.jl index 93c774c..cefcc37 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -194,3 +194,43 @@ function linux_arch_triplet(arch::Symbol) end end + + +function ensure_track_content_fpath(file_path::AbstractString) + + function transform_dependency(match) + e = Meta.parse(match) + return "include_dependency($(e.args[2]), track_content=true)" + end + + content = read(file_path, String) + new_content = replace(content, r"include_dependency.*" => transform_dependency) + + if content != new_content + + chmod(file_path, 0o644) + write(file_path, new_content) + chmod(file_path, 0o444) + @info "include_dependency updated $file_path" + + end +end + + +function ensure_track_content(dir_path::AbstractString) + + for (root, dirs, files) in walkdir(dir_path) + for file in files + if endswith(file, ".jl") + file_path = joinpath(root, file) + try + ensure_track_content_fpath(file_path) + catch + @info "include_dependency skipped $file_path" + end + end + end + end + + return +end