Gradle-lint-plugin不会出现在我的控制台日志中

时间:2018-03-26 17:55:23

标签: android gradle lint

尝试gradle-lint-plugin即使项目很大,我也没有控制台输出。我想我错过了配置中的一些内容,并在此寻求帮助以找到它。

阅读wiki Using-Lint如果lintGradle任务没有找到任何警告可能没有提及,也许这就是我的情况。

这是build.grade。

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
        maven { url 'https://jitpack.io' }
        maven { url "https://jcenter.bintray.com" }
        maven { url 'https://maven.fabric.io/public' }
        google()
    }
    dependencies {
        classpath 'com.netflix.nebula:gradle-lint-plugin:9.0.0'
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.2.0'
        classpath ('com.google.firebase:firebase-plugins:1.0.5') {
            // Note https://issuetracker.google.com/issues/38419426#comment8
            exclude group: 'com.google.guava', module: 'guava-jdk5'
        }
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

plugins {
    id 'nebula.lint' version '9.0.0'
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
        google()
    }
}

apply plugin: 'nebula.lint'
gradleLint.rules  = ['dependency-parentheses']
gradleLint.criticalRules = ['unused-dependency'] // <-- this will fail the build in the event of a violation
// gradleLint.alwaysRun = false

task clean(type: Delete) {
    delete rootProject.buildDir
}

0 个答案:

没有答案