Thanks to visit codestin.com
Credit goes to github.com

Skip to content

kordamp/gm

Repository files navigation

gum

Build Status GoReport Card Coveralls Release Snapcraft ASL2 Licensed donations Patreon orange


Gum is a Gradle/Maven/jbang wrapper written in Go, inspired in https://github.com/dougborg/gdub and https://github.com/srs/gw.

Gum automatically detects if the project is Gradle, Maven, or jbang based and runs the appropriate command. However in the case that Gum guesses wrong you can force a specific build tool to be used. Similarly as gdub, Gum lets you invoke either Gradle or Maven from anywhere within the project structure, not just the root directory.

Usage

Gum supports the following flags

  • -gd displays debug information

  • -gg force Gradle build

  • -gh displays help information

  • -gj force jbang execution

  • -gm force Maven build

  • -gn executes nearest build file

  • -gq run gm in quiet mode

  • -gr do not replace goals/tasks

  • -gv displays version information

Gum will execute the build based on the root build file unless -gn is specified, in which case the nearest build file will be selected. If a specific build file is given (-b, --build-file for Gradle; -f, --file for Maven) then that file will be used instead.

Gum works by passing the given arguments to the resolved tool; it will replace common goal/task names following these mappings

Maven

Gradle

compile

classes

package

assemble

verify

build

verify

check

install

publishToMavenLocal

exec:java

run

dependency:tree

dependencies

The following tasks are mapped from Gradle to Maven only

Gradle

Maven

jar

package

check

verify

You can skip these replacements by defining the -gr flag.

Gum can be used to run Maven and Gradle builds like so:

Maven
$ gm build

Which results in the invocation of either mvnw or mvn with the verify goal as build gets replaced by verify.

Gradle
$ gm verify

Which results in the invocation of either gradlew or gradle with the build goal as verify gets replaced with build.

jbang

Gum will execute a given file (local or remote) if explicitly defined, otherwise scans the the current directory and executes the first file with .java,.jsh, .jar that’s found (in that order).

Configuration

You may configure some aspects of Gum using a TOML based configuration file. There are two possible locations for this file

  • At the project’s root directory. Must be named .gm.toml.

  • At your home directory. For Linux/MacOS it’s $HOME/.gm.toml, for Windows it’s %APPDATA\Gum\gm.toml.

Settings at the project root override those at your home directory. The format is

gm.toml
[general]
# same as passing -gq
quiet = false
# same as passing -gd
debug = false

[gradle]
# if goal/tasks should be replaced, same as passing -gr
replace = true
# if the default replace mappings should be used
defaults = true

# maven -> gradle mappings
[gradle.mappings]
compile = "classes"
"exec:java" = "run"

[maven]
# if goal/tasks should be replaced, same as passing -gr
replace = true
# if the default replace mappings should be used
defaults = true

# gradle -> mappings
[maven.mappings]
build = "verify"

Installation

Homebrew

Use the kordamp/homebrew-tap

$ brew install kordamp/tap/gum

Or use the upgrade or reinstall commands if you have a previous installation of Gum in your system.

Snapcraft

$ sudo snap install --classic gum

Manually

Download the pre-compiled binaries from the releases page and copy to the desired location.

Installing from Source

You need Go installed on your system, follow this link to download and install. Once Go is installed you can invoke the following command to install Gum

go install github.com/kordamp/gm

Executables are installed in the directory named by the GOBIN environment variable, which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH environment variable is not set. Make sure that $HOME/go/bin is in your $PATH. If GOPATH is defined then $GOPATH/bin must be in your $PATH.

Compiling from Source

You need Go installed on your system, follow this link to download and install. Once Go is installed you can invoke the following command to install Gum

Clone:
$ git clone https://github.com/kordamp/gm
$ cd gm
Build:
$ make
Verify:
$ ./gm -gv
Test
$ go test -v ./...

About

Gum is a Gradle/Maven/JBang wrapper written in Go

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •