A personal memorandum for installing gradle on your Mac. I think it's hard to forget and install the jar every time.
$ brew update
Something is an error, so untap as written
$ brew untap homebrew/homebrew-dupes $ brew untap homebrew/homebrew-x11
$ brew install gradle
$ brew cleanup
Move to the directory containing build.gradle etc.
$ gradle
I get this
Welcome to Gradle 5.4! Here are the highlights of this release: - Run builds with JDK12 - New API for Incremental Tasks - Updates to native projects, including Swift 5 support For more details see https://docs.gradle.org/5.4/release-notes.html Starting a Gradle Daemon (subsequent builds will be faster) > Task :help Welcome to Gradle 5.4. To run a build, run gradle... To see a list of available tasks, run gradle tasks To see a list of command-line options, run gradle --help To see more detail about a task, run gradle help --task For troubleshooting, visit https://help.gradle.org BUILD SUCCESSFUL in 12s 1 actionable task: 1 executed
$ gradle tasks
> Task :tasks ------------------------------------------------------------ Tasks runnable from root project ------------------------------------------------------------ Build tasks ----------- assemble - Assembles the outputs of this project. build - Assembles and tests this project. buildDependents - Assembles and tests this project and all projects that depend on it. buildNeeded - Assembles and tests this project and all projects it depends on. classes - Assembles main classes. clean - Deletes the build directory. jar - Assembles a jar archive containing the main classes. testClasses - Assembles test classes. Build Setup tasks ----------------- init - Initializes a new Gradle build. wrapper - Generates Gradle wrapper files. Documentation tasks ------------------- javadoc - Generates Javadoc API documentation for the main source code. Help tasks ---------- buildEnvironment - Displays all buildscript dependencies declared in root project 'ArtNet for Java'. components - Displays the components produced by root project 'ArtNet for Java'. [incubating] dependencies - Displays all dependencies declared in root project 'ArtNet for Java'. dependencyInsight - Displays the insight into a specific dependency in root project 'ArtNet for Java'. dependentComponents - Displays the dependent components of components in root project 'ArtNet for Java'. [incubating] help - Displays a help message. model - Displays the configuration model of root project 'ArtNet for Java'. [incubating] projects - Displays the sub-projects of root project 'ArtNet for Java'. properties - Displays the properties of root project 'ArtNet for Java'. tasks - Displays the tasks runnable from root project 'ArtNet for Java'. Verification tasks ------------------ check - Runs all checks. test - Runs the unit tests. Rules ----- Pattern: clean: Cleans the output files of a task. Pattern: build : Assembles the artifacts of a configuration. Pattern: upload : Assembles and uploads the artifacts belonging to a configuration. To see all tasks and more detail, run gradle tasks --all To see more detail about a task, run gradle help --task BUILD SUCCESSFUL in 2s 1 actionable task: 1 executed
$ gradle build
BUILD SUCCESSFUL in 21s 4 actionable tasks: 4 executed
If successful, a jar file will be generated in the build / libs directory. happiness.
Recommended Posts