-
-
Notifications
You must be signed in to change notification settings - Fork 285
App support in Pkg #3772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
App support in Pkg #3772
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
dfa357c
wip on app support in Pkg
KristofferC 289ab99
also symlink app to `.local/bin`
KristofferC 7f50912
wip on app support in Pkg
KristofferC e6a0c8d
fix from REPL extension
KristofferC 4783717
fixes
KristofferC d3a583a
wip
KristofferC 0f18e31
wip
KristofferC f97e59f
update the docs a bit
KristofferC 5eb96eb
update
KristofferC ca4994f
use manifest if it exists
KristofferC 3f78234
contract status
KristofferC abdae83
Run `mkpath` also in `write_manifest`
fredrikekre 949d4c0
small stuff
KristofferC 2d6d142
remove PATH handling
KristofferC 4ff2dae
add tests and some refactorings
040bacb
actually run tests
KristofferC f787f5b
fixup tests
547374b
fixup from review
bbf4616
fixup windows shim
KristofferC 830ecdc
fix test on windows
KristofferC f341c20
fix shim name on windows
KristofferC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # [**?.** Apps](@id Apps) | ||
|
|
||
| !!! note | ||
| The app support in Pkg is currently considered experimental and some functionality and API may change. | ||
|
|
||
| Some inconveniences that can be encountered are: | ||
| - You need to manually make `~/.julia/bin` available on the PATH environment. | ||
| - The path to the julia executable used is the same as the one used to install the app. If this | ||
| julia installation gets removed, you might need to reinstall the app. | ||
| - You can only have one app installed per package. | ||
|
|
||
| Apps are Julia packages that are intended to be run as a "standalone programs" (by e.g. typing the name of the app in the terminal possibly together with some arguments or flags/options). | ||
| This is in contrast to most Julia packages that are used as "libraries" and are loaded by other files or in the Julia REPL. | ||
|
|
||
| ## Creating a Julia app | ||
|
|
||
| A Julia app is structured similar to a standard Julia library with the following additions: | ||
|
|
||
| - A `@main` entry point in the package module (see the [Julia help on `@main`](https://docs.julialang.org/en/v1/manual/command-line-interface/#The-Main.main-entry-point) for details) | ||
| - An `[app]` section in the `Project.toml` file listing the executable names that the package provides. | ||
|
|
||
| A very simple example of an app that prints the reversed input arguments would be: | ||
|
|
||
| ```julia | ||
| # src/MyReverseApp.jl | ||
| module MyReverseApp | ||
|
|
||
| function (@main)(ARGS) | ||
| for arg in ARGS | ||
| print(stdout, reverse(arg), " ") | ||
| end | ||
| return | ||
| end | ||
|
|
||
| end # module | ||
| ``` | ||
|
|
||
| ```toml | ||
| # Project.toml | ||
|
|
||
| # standard fields here | ||
|
|
||
| [apps] | ||
| reverse = {} | ||
| ``` | ||
| The empty table `{}` is to allow for giving metadata about the app but it is currently unused. | ||
|
|
||
| After installing this app one could run: | ||
|
|
||
| ``` | ||
| $ reverse some input string | ||
| emos tupni gnirts | ||
| ``` | ||
|
|
||
| directly in the terminal. | ||
|
|
||
| ## Installing Julia apps | ||
|
|
||
| The installation of Julia apps are similar to installing julia libraries but instead of using e.g. `Pkg.add` or `pkg> add` one uses `Pkg.Apps.add` or `pkg> app add` (`develop` is also available). | ||
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or "
developrather thanaddis also..."