
Plugin für statische Code-Analyse für Android-Projekte. (Checkstyle, PMD)
Plugin für statische Code-Analyse für Android-Projekte.
Änderungen in <project_dir>/build.gradle:
buildscript {
repositories { jcenter() }
dependencies {
...
classpath 'com.noveogroup.android:check:1.2.5'
...
}
}
Änderungen in <project_dir>/<module_name>/build.gradle:
apply plugin: 'com.noveogroup.android.check'
Die empfohlene Konfiguration ist die Standardkonfiguration (leer).
// keine Konfiguration
check {
abortOnError true
checkstyle { config hard() }
findbugs { config hard() }
pmd { config hard() }
}
check { skip true }
Nur Checkstyle überspringen
check { checkstyle { skip true } }
Nur FindBugs überspringen
check { findbugs { skip true } }
Nur PMD überspringen
check { pmd { skip true } }
// configuration is optional
check {
// skip source code checking or not, false by default
skip true/false
// fails build if code style violation is found, false by default
abortOnError true/false
// configuration of Checkstyle checker
checkstyle {
// skip Checkstyle, false by default
skip true/false
// fails build if Checkstyle rule violation is found, false by default
abortOnError true/false
// configuration file
config project.file('path/to/checkstyle.xml')
// configuration resource
// see http://gradle.org/docs/2.2/release-notes#sharing-configuration-files-across-builds
config resources.text.fromFile(someTask)
// configuration path
config 'path/to/checkstyle.xml'
// predefined configurations: easy and hard
config easy()
config hard()
// by default plugin finds configuration file in <rootProject>/config/checkstyle.xml,
// after that in <project>/config/checkstyle.xml and if there are no configuration
// file, easy() configuration will be used.
// directory for report files
report new File(project.buildDir, 'reports/pmd')
// XML report file
reportXML new File(project.buildDir, 'reports/checkstyle/checkstyle.xml')
// HTML report file
reportHTML new File(project.buildDir, 'reports/checkstyle/checkstyle.html')
}
// configuration of FindBugs checker
findbugs {
// the same configuration as for Checkstyle
// by default plugin finds configuration file in <rootProject>/config/findbugs.xml,
// after that in <project>/config/findbugs.xml and if there are no configuration
// file, easy() configuration will be used.
}
// configuration of PMD checker
pmd {
// the same configuration as for Checkstyle
// by default plugin finds configuration file in <rootProject>/config/pmd.xml,
// after that in <project>/config/pmd.xml and if there are no configuration
// file, easy() configuration will be used.
}
}
Copyright (c) 2017 Noveo Group
Hiermit wird unentgeltlich jeder Person, die eine Kopie dieser Software und der zugehörigen Dokumentationsdateien (die „Software“) erhält, die Erlaubnis erteilt, die Software uneingeschränkt zu nutzen, einschließlich und ohne Einschränkung der Rechte zur Verwendung, Vervielfältigung, Modifikation, Zusammenführung, Veröffentlichung, Verteilung, Unterlizenzierung und/oder zum Verkauf von Kopien der Software, und Personen, denen die Software zur Verfügung gestellt wird, diese Rechte unter folgenden Bedingungen zu gewähren:
Der obige Urheberrechtshinweis und dieser Genehmigungshinweis müssen in allen Kopien oder wesentlichen Teilen der Software enthalten sein.
Sofern in diesem Hinweis nicht anders angegeben, dürfen die Namen der obigen Urheberrechtsinhaber nicht für Werbung oder anderweitige Förderung des Verkaufs, der Nutzung oder anderer Geschäfte mit dieser Software ohne vorherige schriftliche Genehmigung verwendet werden.
DIE SOFTWARE WIRD OHNE JEGLICHE AUSDRÜCKLICHE ODER STILLSCHWEIGENDE GEWÄHRLEISTUNG BEREITGESTELLT, EINSCHLIESSLICH, ABER NICHT BESCHRÄNKT AUF DIE GEWÄHRLEISTUNG DER MARKTGÄNGIGKEIT, DER EIGNUNG FÜR EINEN BESTIMMTEN ZWECK UND DER NICHTVERLETZUNG VON RECHTEN DRITTER. IN KEINEM FALL SIND DIE AUTOREN ODER URHEBERRECHTSINHABER HAFTBAR FÜR JEGLICHE ANSPRÜCHE, SCHÄDEN ODER ANDERE VERPFLICHTUNGEN, OB AUS VERTRAG, UNERLAUBTER HANDLUNG ODER ANDERWEITIG, DIE AUS ODER IM ZUSAMMENHANG MIT DER SOFTWARE ODER DER NUTZUNG ODER ANDEREN GESCHÄFTEN MIT DER SOFTWARE ENTSTEHEN.