Skip to content
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

Suggestions on AppBundler #2

Open
mpeters2 opened this issue Dec 5, 2023 · 4 comments
Open

Suggestions on AppBundler #2

mpeters2 opened this issue Dec 5, 2023 · 4 comments

Comments

@mpeters2
Copy link

mpeters2 commented Dec 5, 2023

First off, I want to say "thank-you" for doing this. Appbundler.jl seems like a huge step for the Julia community: being able to distribute double-clickable applications is a big deal, and without this tool, I wouldn't know where to begin to start tackling this issue. The fact that you've tried to do this for MacOS, Windows, and Linux is even more impressive!

I realize that this is not the final polished version, and it is really a first draft, but I wanted to give some feedback on the documentation that would allow Appbundler to be more accessible to the Julia community at large.

  1. Could you explain the recipes in more detail? What are they for? How do they work? When should I use them, and how do I use them?

  2. I found this example confusing: "bundle_app(MacOS(:x86_64), APP_DIR, "$BUILD_DIR/gtkapp-x64.app")". I'm no MacOS/Unix command-line expert (I'm guessing most of the incoming Julia users are not), but when I read this, I assumed the $BUILD_DIR was some sort of special variable. I initially tried something like this:

AppBundler.bundle_app(MacOS(:aarch64), "/Users/…/Development/AppBuilderVersion/Trichromacy", "$BUILD_DIR/Trichromacy.app")

…and got this as an error:

ERROR: UndefVarError: `BUILD_DIR` not defined`

Of course, this works:

AppBundler.bundle_app(MacOS(:aarch64), "/Users/…/Development/Trichromacy/AppBuilderVersion/Trichromacy", "/Users/…/Development/Trichromacy/AppBuilderVersion/Trichromacy.app")

Is $BUILD_DIR a variable that we should know about? Is it part of AppBundler, but isn't working for some reason? If not, maybe it would be easier to show an example like this:

AppBundler.bundle_app(MacOS(:aarch64), "/Users/…/Development/myAppProject/myApp", "/Users/…/Development/myAppProject/myApp.app")

Take home message: When in doubt, pretend we are dumb!

MacOS

  • Many of us have never had to codesign an app before (and I've been coding on Macs since 1993! I miss Codewarrior…). Maybe include a link to this Youtube video on how to make a certificate:

https://www.youtube.com/watch?v=OpR9-onRZko

  • Also, feel free to include my command line example for codesigning:
sudo codesign --verbose --deep --force --sign "MyCertificate" --options runtime --entitlements "/Users/…/Development/myAppProject/myApp.app/Contents/MacOS/Resources/Entitlements.plist" "/Users/…/Development/myAppProject/myApp.app"

Overall, this is a really cool tool! I can't thank you enough for doing this, as I think this has the potential to have a huge effect on the future of Julia outside of academia.

@JanisErdmanis
Copy link
Member

The recipe system is used when a bundle for either platform is made. It consists of a list of rules specified within the AppBundler.jl/recipes.jl file for each platform. Each rule specifies its origin and destination. The origin/destination can be directories or files. In case the rule is for a file, additional parameters on whether it is treated as a template and whether it needs to be executable (for Linux and macOS) can be provided.

During the build step of a bundle, the rules are run in sequence. The files are copied from the origin to the destination. If the origin of a rule exists in the meta directory, the files are taken from there; otherwise, the origin for a rule is taken from the AppBundler.jl /recipes folder. When the default path of an origin is unspecified, the rule is skipped.

The last bit in the picture is interfering rules. When a previous rule has already affected the destination, the new rule respects the previous rule and skips merging in a particular file. This is useful for flattening the configuration directory structure while retaining the possibility of following a more hierarchical organisation used by the bundle.

In situations when the bundling does not work for the users, which I would like to hear about, they can modify bundle_app for their needs, which is only 40 lines of code to change, add or remove rules.

Let me know how well you could follow this description so I can consider this explanation as part of the docs. I also improved docs bundle_app and added more information on how one can generate a code signing certificate.

@mpeters2
Copy link
Author

mpeters2 commented Dec 5, 2023

Does that mean that if I do not have a meta folder in my source folder, AppBundler automatically picks the correct recipe from AppBuilder/recipes?

@mpeters2
Copy link
Author

mpeters2 commented Dec 5, 2023

BTW: After AppBundler has matured, I think it would be great if the VSCode team could make it part of the user interface, so that users could click a single button to compile a standalone app.

@JanisErdmanis
Copy link
Member

JanisErdmanis commented Dec 5, 2023

Does that mean that if I do not have a meta folder in my source folder, AppBundler automatically picks the correct recipe from AppBuilder/recipes?

It is more delicate than that. The recipe consists of a list of rules which has origin location. If the origin for the rule exists in the MyApp/meta folder, then it is taken from there. If origin doesn't exist there, the rule is taken from AppBundler.jl/recipes unless it doesn't exist there either, in which case it is skipped. This is done for every recipe rule sequentially.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants