Skip to content

Commit

Permalink
Split package into (ApplicationBuilder,ApplicationBuilderRuntimeUtils)
Browse files Browse the repository at this point in the history
Created a separate package for the runtime utilities part of this
Package, called ApplicationBuilderRuntimeUtils. Moved the compile-time
utils from BuildApp into the main ApplicationBuilder module.

This allows getting rid of the weird double-import aspect for BuildApp,
which doesn't work on v0.7 anyway.

Make ApplicationBuilder automatically install ApplicationBuilderRuntimeUtils via Pkg.Clone in build.jl.
  • Loading branch information
NHDaly committed Aug 9, 2018
1 parent 9c07e7c commit 30d90e3
Show file tree
Hide file tree
Showing 18 changed files with 347 additions and 453 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ There is both a native julia interface, in the `BuildApp` module, and a command-

To compile and bundle your julia program into a distributable app, use `BuildApp.build_app_bundle`:
```julia
julia> using ApplicationBuilder; using BuildApp
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)
Expand Down
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
julia 0.6
PackageCompiler
# https://github.com/NHDaly/ApplicationBuilderRuntimeUtils.jl (Not yet registered; must clone manually.)
Glob
ArgParse
Compat
4 changes: 2 additions & 2 deletions build_app.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ArgParse, ApplicationBuilder; using BuildApp
using ArgParse, ApplicationBuilder

const julia_v07 = VERSION > v"0.7-"

Expand Down Expand Up @@ -89,4 +89,4 @@ else
filter!((k, v) -> v (nothing, false), parsed_args)
end

BuildApp.build_app_bundle(juliaprog_main; parsed_args...)
ApplicationBuilder.build_app_bundle(juliaprog_main; parsed_args...)
5 changes: 5 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
try
Pkg.installed("ApplicationBuilderRuntimeUtils")
catch
Pkg.clone("https://github.com/NHDaly/ApplicationBuilderRuntimeUtils.jl.git")
end
4 changes: 2 additions & 2 deletions examples/blink.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# examples/blink.jl "HelloBlink"

using Blink
using ApplicationBuilder
using ApplicationBuilderRuntimeUtils

# In order to distribute this Application, we've copied all its dependencies
# into the .app bundle via the -R and -L build flags.
Expand Down Expand Up @@ -80,7 +80,7 @@ end
Base.@ccallable function julia_main(args::Vector{String})::Cint
# Note that we must call this function in order for Blink to find the
# resources we've copied into the Application bundle.
ApplicationBuilder.App.change_dir_if_bundle()
ApplicationBuilderRuntimeUtils.change_dir_if_bundle()

# Apparently starting Electron too quickly means the OS doesn't get a
# chance to find the name of the application...
Expand Down
2 changes: 1 addition & 1 deletion examples/commandline_hello.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# A super-simple command line program that just prints hello.
# Build this with the `commandline_app=true` flag in `BuildApp.build_app_bundle`.
# Build this with the `commandline_app=true` flag in `ApplicationBuilder.build_app_bundle`.

Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
println("Hi what's your name?")
Expand Down
4 changes: 2 additions & 2 deletions examples/hello.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using ApplicationBuilder
using ApplicationBuilderRuntimeUtils

# Create a temporary .html file, and open it to share the greetings.
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
ApplicationBuilder.App.change_dir_if_bundle()
ApplicationBuilderRuntimeUtils.change_dir_if_bundle()

tmpdir = mktempdir()
filename = joinpath(tmpdir, "hello.html")
Expand Down
4 changes: 2 additions & 2 deletions examples/libui.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ApplicationBuilder
using ApplicationBuilderRuntimeUtils

using Libui

Expand Down Expand Up @@ -173,7 +173,7 @@ end


Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
ApplicationBuilder.App.change_dir_if_bundle()
ApplicationBuilderRuntimeUtils.change_dir_if_bundle()

global progressbar = uiNewProgressBar()
global spinbox = uiNewSpinbox(0, 100)
Expand Down

0 comments on commit 30d90e3

Please sign in to comment.