-
-
Save Byrth/998e38b7af1d4ca9669711afb0876c8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Pkg | |
| Pkg.add("PackageCompiler") | |
| Pkg.instantiate() | |
| using PackageCompiler | |
| # Switch back to the default if currently using a custom sysimage | |
| try restore_default_sysimage() catch end | |
| # Make Manifest.toml | |
| manifest = Pkg.TOML.parsefile(joinpath(pwd(),"Manifest.toml")) | |
| cd("..") | |
| !isdir("tmp") && mkdir("tmp") | |
| open("tmp/Manifest.toml","w") do io | |
| Pkg.TOML.print(io, manifest) | |
| end | |
| # Make Project.toml | |
| lines = String[] | |
| push!(lines, "name = \"Fake\"") | |
| push!(lines, "version = \"1.0.0\"") | |
| push!(lines, "") | |
| push!(lines, "[deps]") | |
| append!(lines, [ "$k = \"$(v[1]["uuid"])\"" for (k,v) in manifest]) | |
| push!(lines, "") | |
| open("tmp/Project.toml","w") do io | |
| write(io, join(lines, "\n")) | |
| end | |
| # Make/Deploy sysimage | |
| Pkg.activate("tmp") | |
| Pkg.instantiate() | |
| Pkg.resolve() # not necessary, but sorts things | |
| create_sysimage(Symbol.(collect(keys(manifest))); replace_default=true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment