• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

xvik/gradle-quality-plugin: Gradle quality plugin for Java and Groovy

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

xvik/gradle-quality-plugin

开源软件地址(OpenSource Url):

https://github.com/xvik/gradle-quality-plugin

开源编程语言(OpenSource Language):

Groovy 91.9%

开源软件介绍(OpenSource Introduction):

Gradle quality plugin

License CI Appveyor build status codecov

DOCUMENTATION http://xvik.github.io/gradle-quality-plugin

About

Static code analysis for Java and Groovy projects using Checkstyle, PMD, CPD, SpotBugs and CodeNarc. Plugin implements unified console output for all quality plugins, which greatly simplifies developer workflow: only console required for working with violations and makes it feel the same as java compiler errors.

For example, in IntelliJ Idea it would look like:

Features:

  • Zero configuration by default: provided opinionated configs applied to all quality plugins
    • Default configuration files may be customized
  • Adds extra javac lint options to see more warnings
  • Complete console output for all quality plugins
  • Html and xml reports for all plugins (custom xsl used for findbugs html report because it can't generate both xml and html reports)
  • Grouping tasks to run registered quality plugins for exact source set (e.g. checkQualityMain)
Summary
  • Configuration: quality
  • Tasks:
    • initQualityConfig - copy default configs for customization
    • checkQuality[Main] - run quality tasks for main (or any other) source set
  • Enable plugins: Checkstyle, PMD, SpotBugs, CodeNarc

Setup

NOTE: when updating plugin version in your project don't forget to call clean task to remove cached configs from previous plugin version

Maven Central Gradle Plugin Portal

plugins {
    id 'ru.vyarus.quality' version '4.7.0'
}

OR

buildscript {
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
    dependencies {
        classpath 'ru.vyarus:gradle-quality-plugin:4.7.0'
    }
}
apply plugin: 'ru.vyarus.quality'

Minimal requirements: java 8, gradle 5.6

Compatibility

Plugin compiled for java 8, compatible with java 11

Gradle Version
5.6 4.7.0
5.1 4.2.2
4.1 3.4.0
older 2.4.0

Java tools require sourceCompatibility=1.8 (or above).

Version 3.3.0 is the latest supporting sourceCompatibility=1.6

Snapshots

Snapshots may be used through JitPack
  • Go to JitPack project page
  • Select Commits section and click Get it on commit you want to use (you may need to wait while version builds if no one requested it before) or use master-SNAPSHOT to use the most recent snapshot

For gradle before 6.0 use buildscript block with required commit hash as version:

buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath 'ru.vyarus:gradle-quality-plugin:b9474cab84'
    }
}
apply plugin: 'ru.vyarus.quality'

For gradle 6.0 and above:

  • Add to settings.gradle (top most!) with required commit hash as version:

    pluginManagement {
        resolutionStrategy {
            eachPlugin {
                if (requested.id.namespace == 'ru.vyarus.quality') {
                    useModule('ru.vyarus:gradle-quality-plugin:b9474cab84')
                }
            }
        }
        repositories {
            maven { url 'https://jitpack.io' }
            gradlePluginPortal()          
        }
    }    
  • Use plugin without declaring version:

    plugins {
        id 'ru.vyarus.quality'
    }

Usage

Read documentation

Might also like


gradle plugin generator




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap