google-java-format-gradle-plugin | Gradle plugin that utilizes google | Plugin library

 by   sherter Groovy Version: v0.9 License: MIT

kandi X-RAY | google-java-format-gradle-plugin Summary

kandi X-RAY | google-java-format-gradle-plugin Summary

google-java-format-gradle-plugin is a Groovy library typically used in Plugin, Gradle, Maven applications. google-java-format-gradle-plugin has no vulnerabilities, it has a Permissive License and it has low support. However google-java-format-gradle-plugin has 4 bugs. You can download it from GitHub.

A Gradle plugin that utilizes google-java-format to format the Java source files in your Gradle project.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              google-java-format-gradle-plugin has a low active ecosystem.
              It has 178 star(s) with 28 fork(s). There are 10 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 16 open issues and 44 have been closed. On average issues are closed in 69 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of google-java-format-gradle-plugin is v0.9

            kandi-Quality Quality

              OutlinedDot
              google-java-format-gradle-plugin has 4 bugs (4 blocker, 0 critical, 0 major, 0 minor) and 7 code smells.

            kandi-Security Security

              google-java-format-gradle-plugin has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              google-java-format-gradle-plugin code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              google-java-format-gradle-plugin is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              google-java-format-gradle-plugin releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 724 lines of code, 66 functions and 24 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of google-java-format-gradle-plugin
            Get all kandi verified functions for this library.

            google-java-format-gradle-plugin Key Features

            No Key Features are available at this moment for google-java-format-gradle-plugin.

            google-java-format-gradle-plugin Examples and Code Snippets

            No Code Snippets are available at this moment for google-java-format-gradle-plugin.

            Community Discussions

            QUESTION

            Gradle: Call Task from Imported Plugin in My Own Tasks
            Asked 2020-Nov-02 at 22:34

            I'm used to Maven but currently I'm using Gradle and I'm not really sure how to call tasks defined by other plugins. (Edit: I'm able to call these tasks in the CLI, but I'd like to also invoke them in my own, custom-defined tasks.)

            But I'm importing this plugin to format (and enforce format) of my Java project; the tasks I'm most interested in calling are goJF and verGJF.

            I've tried a few ways to either call included tasks and I've done even more Googling. I can share some of the (probably embarrassing) ways I've tried to call other tasks if it's helpful, but figured that might be unnecessary information at this point.

            Here is my build.gradle:

            ...

            ANSWER

            Answered 2020-Nov-02 at 20:48

            A few distinctions to begin with. The built in tasks defined by the plugin are called googleJavaFormat and verifyGoogleJavaFormat.

            These tasks are immediately available to you once you have included the plugin which it seems you have done correctly from what I can see.

            On the gradle command line, gradle implements a abbreviation functionality where you can call things with shorthand like:

            Source https://stackoverflow.com/questions/64652901

            QUESTION

            How can I configure Gradle google-java-format plugin to run goJF in the build step?
            Asked 2020-Apr-05 at 05:30

            We wired https://github.com/sherter/google-java-format-gradle-plugin into our project per the readme.

            We also wired in a pre-commit hook to run the plugin before committing, which ensures that all of the code in a changelist is formatted before pushing it, which avoids errors in Jenkins when we run the verGJF task.

            But we have to keep remembering to run goJF locally before running ./gradlew build, or the build fails with formatting errors.

            We worked around this by adding the https://plugins.jetbrains.com/plugin/8527-google-java-format and https://plugins.jetbrains.com/plugin/7642-save-actions plugins for IntelliJ, enabling the google-java-format plugin, and configuring the save-actions plugin to format on save.

            But that's a lot of extra configuration a developer has to remember to go through, plus it means they can't format code the way they want while working on it, and only have it be reformatted at the point of build or commit.

            We'd prefer an all-Gradle solution, so that the goJF task is run before the build task (and before the verGJF task, which is already bound to the build task by the google-java-format Gradle plugin).

            We couldn't figure out how to do that. Does someone else know?

            ...

            ANSWER

            Answered 2020-Apr-05 at 05:30

            It sounds like you want to essentially always ensure that the code is properly formatted before the verifyGoogleJavaFormat task is run (and could complain). In that case, I’d simply make the googleJavaFormat task a dependency of the verifyGoogleJavaFormat task. In your build.gradle file, after you have applied the google-java-format plugin, simply add the following:

            Source https://stackoverflow.com/questions/61033598

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install google-java-format-gradle-plugin

            Apply the plugin in your build script (follow these instructions for Gradle versions below 2.1). Make sure you have defined a repository that contains version 1.8 of google-java-format. Execute the task googleJavaFormat to format all *.java files in the project. Execute the task verifyGoogleJavaFormat to verify that all *.java files are formatted properly.
            Apply the plugin in your build script (follow these instructions for Gradle versions below 2.1) plugins { id 'com.github.sherter.google-java-format' version '0.9' }
            Make sure you have defined a repository that contains version 1.8 of google-java-format repositories { jcenter() // or mavenCentral() }
            Execute the task googleJavaFormat to format all *.java files in the project $ ./gradlew goJF
            Execute the task verifyGoogleJavaFormat to verify that all *.java files are formatted properly $ ./gradlew verGJF
            On every push to the master branch Travis runs the tests and, if all tests pass, publishes the built artifact to Sonatype’s snapshots repository. Use the following build script snippet for the current snapshot version:.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/sherter/google-java-format-gradle-plugin.git

          • CLI

            gh repo clone sherter/google-java-format-gradle-plugin

          • sshUrl

            git@github.com:sherter/google-java-format-gradle-plugin.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link