From 6e54c805b4f9602774b9fbfe2d09c8db2a405d49 Mon Sep 17 00:00:00 2001 From: Nathan Daly Date: Sat, 21 Jul 2018 18:33:32 -0400 Subject: [PATCH] Add commandline_hello examples --- examples/commandline_hello.jl | 8 ++++++++ test/build_examples/commandline_hello.jl | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 examples/commandline_hello.jl create mode 100644 test/build_examples/commandline_hello.jl diff --git a/examples/commandline_hello.jl b/examples/commandline_hello.jl new file mode 100644 index 0000000..e5d4d02 --- /dev/null +++ b/examples/commandline_hello.jl @@ -0,0 +1,8 @@ +# A super-simple command line program that just prints hello. +# Build this with the `commandline_app=true` flag in `BuildApp.build_app_bundle`. + +Base.@ccallable function julia_main(ARGS::Vector{String})::Cint + println("Oh hi, World!") + println("Current working directory: $(pwd())") + return 0 +end diff --git a/test/build_examples/commandline_hello.jl b/test/build_examples/commandline_hello.jl new file mode 100644 index 0000000..eb1e5aa --- /dev/null +++ b/test/build_examples/commandline_hello.jl @@ -0,0 +1,7 @@ +using ApplicationBuilder; using BuildApp + +# Allow this file to be called either as a standalone file to build the above +# example, or from runtests.jl using a provided builddir. +isdefined(:builddir) || (builddir=nothing) # nothing == default builddir. + +build_app_bundle(examples_hello, commandline_app=true, builddir=builddir)