gpt4 book ai didi

android - Gradle 插件(findbugs、pmd、jdepend、checkstyle)不工作

转载 作者:行者123 更新时间:2023-11-29 01:15:30 25 4
gpt4 key购买 nike

我的项目有以下应用 bulild.gradle。当我运行命令 gradle check 时,app/build/ 文件夹中没有报告任何输出。我基本上对以前的项目使用了相同的代码,它似乎工作得很好。

apply plugin: 'com.android.application'
apply plugin: "findbugs"
apply plugin: 'pmd'
apply plugin: "jdepend"
apply plugin: 'checkstyle'

findbugs {
ignoreFailures = false
effort = "max"
reportLevel = "low"
}

pmd {
ignoreFailures = true
}

jdepend{
ignoreFailures = true
}

tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}

tasks.withType(Checkstyle) {
reports {
xml.enabled false
html.enabled true
html.stylesheet resources.text.fromFile('config/xsl/checkstyle-custom.xsl')
}
}

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "dat255.refugeeevent"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.google.android.gms:play-services:9.6.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.google.code.gson:gson:2.7'
testCompile 'junit:junit:4.12'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.github.bumptech.glide:glide:3.5.2'
compile files ('libs/microsoft-translator-java-api-0.6.2-jar-with-dependencies.jar')
}

最佳答案

查看 gradle fury 的质量插件,适用于 android 和非 android 项目 https://github.com/gradle-fury/gradle-fury .我们使用它有一些强制报告站点的插件。它主要基于其他人的工作,并进行了大量调整,使其在 Android 和非 Android 项目中都能正常工作。

应用它
所有项目{
申请自:“https://raw.githubusercontent.com/gradle-fury/gradle-fury/master/gradle/quality.gradle”
}

然后你需要这里的内容:https://github.com/gradle-fury/gradle-fury/tree/master/config克隆到你的仓库中。只需 config 文件夹,其余内容不需要。

最后,要么调用任何需要检查的 gradle 任务。所以以下任何一项都可以解决问题

  • gradlew 构建
  • gradlew 检查
  • gradlew install(如果你正在运行来自 fury 的 maven 支持)

关于android - Gradle 插件(findbugs、pmd、jdepend、checkstyle)不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40004876/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com