• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

NHDaly/ApplicationBuilder.jl: [deprecated] Compile, bundle, and release julia so ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

NHDaly/ApplicationBuilder.jl

开源软件地址:

https://github.com/NHDaly/ApplicationBuilder.jl

开源编程语言:

Julia 95.0%

开源软件介绍:

Deprecation Warning

This package is no longer supported. Almost everything this package did is now supported in PackageCompiler.jl itself, out of the box.

If you are still using this package, or want to continue its development, let me know and I can make you a maintainer! :)

Julia Application Builder

Travis Build Status Appveyor Build status Coverage Status

Turn your julia program into a standalone, distributable, statically-compiled "App"!

ApplicationBuilder compiles a julia program and bundles it up into a distributable application, on macOS, Windows and Linux! After building, your users can download your application and run it without having Julia installed.

ApplicationBuilder

To compile and bundle your julia program into a distributable app, use ApplicationBuilder.build_app_bundle:

julia> using ApplicationBuilder
help?> build_app_bundle()
  # 1 method for generic function "build_app_bundle":
  build_app_bundle(juliaprog_main; appname, builddir, resources, libraries, verbose, bundle_identifier, app_version, icns_file, certificate, entitlements_file, snoopfile, autosnoop, commandline_app) in ApplicationBuilder at /Users/daly/.julia/v0.6/ApplicationBuilder/src/ApplicationBuilder.jl:47

Usage

To build a julia program into an application, you'll need to do two steps:

  1. Wrap your code in julia_main function. If the main entry-point to your code is a function, my_code(), it would look like this:
    # my_julia_main.jl
    include("my_code.jl")
    Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
        return my_code()
    end
    The easiest thing to do is to maintain this as a separate script, but you can put this anywhere in your project.
  2. Call build_app_bundle with the file that provides julia_main. The easiest way to do this is to maintain a build script, e.g.:
    # build.jl
    using ApplicationBuilder
    build_app_bundle("src/my_julia_main.jl", appname="MyCode");

Compatibility

ApplicationBuilder supports macOS, Windows, and Linux. Currently, ApplicationBuilder doesn't do cross-compilation, so to compile for Windows, you need to run it from a Windows machine, etc.

Running an example:

After cloning the repository, you can build an App out of the example program, examples/hello.jl, like this:

julia> build_app_bundle("$(homedir())/.julia/v0.6/ApplicationBuilder/examples/hello.jl", appname="HelloWorld", verbose=true);

or like this:

$ julia build_app.jl -v examples/hello.jl "HelloWorld"

This will produce builddir/HelloWorld.app, which you can double click, and it will indeed greet you!

The simple example HelloWorld.app has no binary dependencies -- that is, it doesn't need any extra libraries besides Julia. Many Julia packages come bundled with their own binary dependencies, and if you want to use them in your app, you'll have to add those dependencies via the libraries (-L) option for libs and resources (-R) for bundle resources.

More examples

There are many more examples in the examples directory, each of which have a corresponding build file in the test/build_examples directory. You can build an example simply by running the build file:

julia> include("$(homedir())/.julia/v0.6/ApplicationBuilder/test/build_examples/commandline_hello.jl")

build_app.jl (The command-line tool)

There is also a command-line interface, through build_app.jl, if you prefer it. The main development is on the Julia API, though, so this sometimes lags behind. Feel free to send a PR if it's missing anything! :)

Run julia build_app.jl -h for help:

usage: build_app.jl [-v] [-R <resource>] [-L <file>] [--icns <file>]
                    [-h] juliaprog_main [appname] [builddir]

positional arguments:
  juliaprog_main        Julia program to compile -- must define
                        julia_main()
  appname               name to call the generated .app bundle
  builddir              directory used for building, either absolute
                        or relative to the Julia program directory
                        (default: "builddir")

optional arguments:
  -v, --verbose         increase verbosity
  -R, --resource <resource>
                        specify files or directories to be copied to
                        MyApp.app/Contents/Resources/. This should be
                        done for all resources that your app will need
                        to have available at runtime. Can be repeated.
  -L, --lib <file>      specify user library files to be copied to
                        MyApp.app/Contents/Libraries/. This should be
                        done for all libraries that your app will need
                        to reference at runtime. Can be repeated.
  --icns <file>         .icns file to be used as the app's icon
  -h, --help            show this help message and exit

  examples:
     # Build HelloApp.app from hello.jl
     build_app.jl hello.jl HelloApp
     # Build MyGame, and copy in imgs/, mus.wav and all files in libs/
     build_app.jl -R imgs -R mus.wav -L lib/* main.jl MyGame

License

This project is licensed under the terms of the MIT license.

Thanks

Thanks for the help from these contributors and everyone else!:




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap