Giter Club home page Giter Club logo

incrementlint's Introduction

IncrementLint

该项目主要针对Android项目编写lint gradle 插件,实现lint增量检查。参考:自定义lint增量检查

功能描述

1、自定义Android常用规则(参见lib-rules)
2、利用gradle插件和版本管理(git或svn)实现对修改代码进行检查,避免大型项目代码量过大导致检查时间长的问题 3、该项目保证仅检查java代码的正确性

使用方式

1、将output中的文件拷贝到某文件夹 2、在项目根目录的build.gradle添加如下信息:

buildscript {
	// 添加公共信息
    ext {
        REMOTE_URL = new File(rootDir.absolutePath, "output").toURI() //todo 修改为output中文件存放路径
        GROUP = 'com.jianghongkui.lint'
        LIB_VERSION = '1.0.0'
    }
    repositories {
        maven { url REMOTE_URL } //添加URL
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.30"
        classpath "$GROUP:increment:$LIB_VERSION" //添加插件包
    }
}

3、在app的build.gradle中添加插件和自定义lint规则包

apply plugin: 'com.android.application'
apply plugin: 'IncrementLint' //添加gradle插件

dependencies {
    ....
    //添加自定义的lint规则包
    lintChecks project(path: ':lib-rules')//lintChecks "{group}:{name}:{version}"
}

###参考
Android Lint增量扫描实战纪要
Android Lint工作原理剖析

incrementlint's People

Contributors

tianwailaike61 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.