umple / homebrew-umple

Formulae for the use of Umple on Mac-OS with the brew command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is the original home of the homebrew formula for Umple

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).

Prerequisite :

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: Screen Shot 2021-08-19 at 4 48 22 PM
    • The install method moves a file from the original location to the Pathname
    • 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

Testing :

  • 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

Before opening a pull request :

Homebrew has a checklist that needs to be followed before opening a PR:

How to open a homebrew Pull Request: https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request

How to update :

About

Formulae for the use of Umple on Mac-OS with the brew command

License:MIT License


Languages

Language:Ruby 100.0%