Skip to content

Commit

Permalink
track_content override for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Janis Erdmanis committed Jul 2, 2024
1 parent 357f4a5 commit b6e5672
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
40 changes: 40 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 comments on commit b6e5672

@JanisErdmanis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/110299

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.4 -m "<description of version>" b6e56722ef98b4702db0b71314072eb348953bc0
git push origin v0.1.4

Please sign in to comment.