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

novoda/gradle-static-analysis-plugin: Easy setup of static analysis tools for An ...

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

开源软件名称(OpenSource Name):

novoda/gradle-static-analysis-plugin

开源软件地址(OpenSource Url):

https://github.com/novoda/gradle-static-analysis-plugin

开源编程语言(OpenSource Language):

Groovy 97.6%

开源软件介绍(OpenSource Introduction):

[DEPRECATED] Gradle static analysis plugin

⚠️ A fork of this project is maintained at https://github.com/GradleUp/static-analysis-plugin/ Please migrate by using com.gradleup.static-analysis plugin id instead.

Bintray

A Gradle plugin to easily apply the same setup of static analysis tools across different Android, Java or Kotlin projects.

Supports Task Configuration Avoidance so that you have zero overhead in build speeds when you use this plugin!

Description

Gradle supports many popular static analysis (Checkstyle, PMD, FindBugs, etc) via a set of built-in plugins. Using these plugins in an Android module will require an additional setup to compensate for the differences between the model adopted by the Android plugin compared to the the Java one.

The gradle-static-analysis-plugin aims to provide:

  • flexible, configurable penalty strategy for builds
  • easy, Android-friendly integration for all static analysis
  • convenient way of sharing same setup across different projects
  • healthy, versionable and configurable defaults

Supported tools

The plugin supports various static analysis tools for Java, Kotlin and Android projects:

Please note that the tools availability depends on the project the plugin is applied to. For more details please refer to the supported tools page.

Tools in-consideration

  • CPD (Duplicate Code Detection) #150
  • error-prone #151
  • Jetbrains IDEA Inspections #152

For all tools in consideration, please refer to issues.

Out-of-the-box support for Android projects

Android projects use a Gradle model that is not compatible with the Java one, supported by the built-in static analysis tools plugins. Applying gradle-static-analysis-plugin to your Android project will make sure all the necessary tasks are created and correctly configured without any additional hassle.

Add the plugin to your project

Apply the plugin from jCenter as a classpath dependency

buildscript {
    repositories {
       jcenter()
    }
    dependencies {
        classpath 'com.novoda:gradle-static-analysis-plugin:1.2'
    }
}

apply plugin: 'com.novoda.static-analysis'

or from the Gradle Plugins Repository:

plugins {
    id 'com.novoda.static-analysis' version '1.2'
}

Simple usage

A typical configuration for the plugin will look like:

staticAnalysis {
    penalty {
        maxErrors = 0
        maxWarnings = 0
    }
    checkstyle { }
    pmd { }
    findbugs { }
    spotbugs { }
    detekt { }
    lintOptions { }
}

This will enable all the tools with their default settings and create evaluateViolations task. Running ./gradlew evaluateViolations task will run all configured tools and print the reports to console. For more advanced configurations, please refer to the advanced usage and to the supported tools pages.

Sample app

There are two sample Android projects available, one consisting of a regular app - available here - and the other comprising a multi-module setup available here. Both sample projects showcase a setup featuring Checkstyle, FindBugs, SpotBugs, PMD, Lint, Ktlint and Detekt.

Snapshots

CI status Download from Bintray

Snapshot builds from develop are automatically deployed to a repository that is not synced with JCenter. To consume a snapshot build add an additional maven repo as follows:

repositories {
    maven {
        url 'https://dl.bintray.com/novoda-oss/snapshots/'
    }
}

You can find the latest snapshot version following this link.

Roadmap

This project is routinely used by many Novoda projects and by other external projects with no known critical issues.

Future improvements and new tool integrations can be found on the repository's issue tracker.




鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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