Skip to content

Commit 28b5528

Browse files
committed
Upgrade to support Julia v0.7/v1.0.
Remove unnecessary split-modules by always performing `change_dir_if_bundle` automatically, and thus removing the need for users to `import ApplicationBuilder` into their programs! :) Fix deprecations/warnings to get up to 1.0 support.
1 parent 4ef1dc2 commit 28b5528

18 files changed

+430
-481
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ There is both a native julia interface, in the `BuildApp` module, and a command-
1515

1616
To compile and bundle your julia program into a distributable app, use `BuildApp.build_app_bundle`:
1717
```julia
18-
julia> using ApplicationBuilder; using BuildApp
18+
julia> using ApplicationBuilder
1919
help?> build_app_bundle()
2020
# 1 method for generic function "build_app_bundle":
2121
build_app_bundle(juliaprog_main; appname, builddir, resources, libraries, verbose, bundle_identifier, app_version, icns_file, certificate, entitlements_file)

build_app.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using ArgParse, ApplicationBuilder; using BuildApp
1+
using ArgParse, ApplicationBuilder
22

33
const julia_v07 = VERSION > v"0.7-"
44

@@ -89,4 +89,4 @@ else
8989
filter!((k, v) -> v (nothing, false), parsed_args)
9090
end
9191

92-
BuildApp.build_app_bundle(juliaprog_main; parsed_args...)
92+
ApplicationBuilder.build_app_bundle(juliaprog_main; parsed_args...)

examples/blink.jl

-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# examples/blink.jl "HelloBlink"
1515

1616
using Blink
17-
using ApplicationBuilder
1817

1918
# In order to distribute this Application, we've copied all its dependencies
2019
# into the .app bundle via the -R and -L build flags.
@@ -84,10 +83,6 @@ function helloFromBlink()
8483
end
8584

8685
Base.@ccallable function julia_main(args::Vector{String})::Cint
87-
# Note that we must call this function in order for Blink to find the
88-
# resources we've copied into the Application bundle.
89-
ApplicationBuilder.App.change_dir_if_bundle()
90-
9186
# Apparently starting Electron too quickly means the OS doesn't get a
9287
# chance to find the name of the application...
9388
sleep(2)

examples/commandline_hello.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# A super-simple command line program that just prints hello.
2-
# Build this with the `commandline_app=true` flag in `BuildApp.build_app_bundle`.
2+
# Build this with the `commandline_app=true` flag in `ApplicationBuilder.build_app_bundle`.
33

44
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
55
println("Hi what's your name?")
66
name = readline()
7-
println("Oh hi, $name\! It's a pleasure to meet you.")
7+
println("Oh hi, $name. It's a pleasure to meet you.")
88
println("By the way, here's the current working directory:\n'$(pwd())'")
99

1010
println("\nGoodbye! (Press enter to exit)")

examples/hello.jl

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
using ApplicationBuilder
2-
31
# Create a temporary .html file, and open it to share the greetings.
42
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
5-
ApplicationBuilder.App.change_dir_if_bundle()
6-
73
tmpdir = mktempdir()
84
filename = joinpath(tmpdir, "hello.html")
95
open(filename, "w") do io

examples/libui.jl

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using ApplicationBuilder
2-
31
using Libui
42

53

@@ -173,8 +171,6 @@ end
173171

174172

175173
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
176-
ApplicationBuilder.App.change_dir_if_bundle()
177-
178174
global progressbar = uiNewProgressBar()
179175
global spinbox = uiNewSpinbox(0, 100)
180176
global slider = uiNewSlider(0, 100)

examples/sdl.jl

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
# test/build_examples/sdl.jl
77
# https://github.com/NHDaly/ApplicationBuilder.jl/tree/master/test/build_examples/sdl.jl
88

9-
using ApplicationBuilder
10-
119
using SimpleDirectMediaLayer
1210
SDL2 = SimpleDirectMediaLayer
1311

12+
using Compat.Pkg
13+
1414
fontFile = joinpath(Pkg.dir("SimpleDirectMediaLayer"),
1515
"assets","fonts","FiraCode","ttf","FiraCode-Regular.ttf")
1616

@@ -80,7 +80,6 @@ function helloFromSDL()
8080
end
8181

8282
Base.@ccallable function julia_main(args::Vector{String})::Cint
83-
ApplicationBuilder.App.change_dir_if_bundle()
8483
helloFromSDL()
8584
return 0
8685
end

0 commit comments

Comments
 (0)