To install it on Mac-OS (or Linux as an alterative to managers like apt) use the brew install umple
command on those platforms. It will create a command called 'umple' which invokes the umple compiler Java jar.
Umple has openjdk as a dependency, which results in several GB of other files being installed.
How we made Umple available from Homebrew, the package manager for Macs (and also available on Linux).
- Install Homebrew: https://docs.brew.sh/Installation
Create a new formula (https://docs.brew.sh/Formula-Cookbook) :
- A formula is a package definition written in Ruby.
- We followed the Formula Cookbook to create a new formula.
- brew create → creates template brew formula
- Formulas are installed at: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
- Umple formula:
- To create the formula one needs a URL to a zip or tarball. I decided to use a link to umple's latest JAR file because other applications in homebrew based in Java did the same.
- The description needs to be 80 characters or less
- The Homepage must be a https link
- The URL is the link to umple's latest JAR file
- Version tag is optional since homebrew tries to guess the version from the URL
- In our case, homebrew got our version wrong so I had to add it
- Sha256 and license are automatically generated
- Had to add our dependencies (ant, ant-contrib and openjdk)
- Bottle:unneeded
- Without this line, an error will occur when installing and umple will not get installed
- In the PR, homebrew contributors commented to remove the line
- Bottle do block is auto generated by the brew's CI when the PR is accepted -Install block:
- Homebrew contributors were very specific on the syntax used to install the application. It is similar for all java based applications available from Homebrew. Originally we were running shell commands through the ruby formula, but that was not accepted.
- Homebrew packages have specific file structure:
- The install method moves a file from the original location to the Pathname
- https://rubydoc.brew.sh/Pathname.html#install-instance_method
- The write_jar_script method takes the target jar, a name and writes an exec script that invokes a Java jar
- Test Block:
- Writes a simple ump file
- Class X with one attribute
- Tests the umple compile command
- Use the assert_predicate to check if the java and class file were created
- Writes a simple ump file
- Using the command: brew install umple
- If installation was successful, umple command will work
- Brew remove umple: will uninstall umple
- Homebrew Packages Are Installed at: /usr/local/Cellar/
- Have to run: brew audit --new (for new formula) or brew audit --strict (existing formula)
- This command will return errors in the formula
- Follow Cookbook (https://docs.brew.sh/Formula-Cookbook) to push to homebrew-core
Homebrew has a checklist that needs to be followed before opening a PR:
- Have you followed the guidelines for contributing? (https://github.com/Homebrew/homebrew-core/blob/HEAD/CONTRIBUTING.md)
- Have you ensured that your commits follow the commit style guide? (https://docs.brew.sh/Formula-Cookbook#commit)
- Have you checked that there aren't other open pull requests for the same formula update/change? (https://github.com/Homebrew/homebrew-core/pulls)
- Have you built your formula locally with brew install --build-from-source , where is the name of the formula you're submitting?
- Is your test running fine brew test , where is the name of the formula you're submitting?
- Does your build pass brew audit --strict (after doing brew install --build-from-source )? If this is a new formula, does it pass brew audit --new ?
How to open a homebrew Pull Request: https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request
- Update URL and sha256
- URL: get jar link from github release (right click, Copy Link Address)
- Generate sha256: shasum -a 256
- Bottle do … end block should be left as is (Updated automatically by homebrew)
- Run brew uses to verify if any other formula is dependant on it
- If so, run brew reinstall
- Link: https://docs.brew.sh/Formula-Cookbook#updating-formulae
- Submit a new version of an existing formula: brew bump-formula-pr
- Submit to update https://github.com/Homebrew/homebrew-core/blob/master/Formula/umple.rb
- Use --help
- brew bump-formula-pr --url --sha256 --version umple