mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Add checkstyle configuration and apply to all modules
This commit is contained in:
@@ -5,6 +5,7 @@ targetCompatibility = 1.8
|
||||
apply plugin: 'ru.vyarus.animalsniffer'
|
||||
apply plugin: 'witness'
|
||||
apply from: 'witness.gradle'
|
||||
apply plugin: 'checkstyle'
|
||||
|
||||
dependencies {
|
||||
implementation "com.google.dagger:dagger:$dagger_version"
|
||||
|
||||
@@ -7,6 +7,7 @@ apply plugin: 'idea'
|
||||
apply plugin: 'witness'
|
||||
apply from: 'witness.gradle'
|
||||
apply from: '../dagger.gradle'
|
||||
apply plugin: 'checkstyle'
|
||||
|
||||
dependencies {
|
||||
implementation project(path: ':bramble-api', configuration: 'default')
|
||||
|
||||
@@ -6,6 +6,7 @@ apply plugin: 'idea'
|
||||
apply plugin: 'witness'
|
||||
apply from: 'witness.gradle'
|
||||
apply from: '../dagger.gradle'
|
||||
apply plugin: 'checkstyle'
|
||||
|
||||
configurations {
|
||||
tor
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'witness'
|
||||
apply from: 'witness.gradle'
|
||||
apply plugin: 'checkstyle'
|
||||
// Need to manually apply this as the Java plugin is not applied to this module hence this is not
|
||||
// done automatically.
|
||||
apply from: "${rootProject.rootDir}/gradle/checkstyle.gradle"
|
||||
|
||||
def getStdout = { command, defaultValue ->
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
|
||||
@@ -5,6 +5,7 @@ targetCompatibility = 1.8
|
||||
apply plugin: 'ru.vyarus.animalsniffer'
|
||||
apply plugin: 'witness'
|
||||
apply from: 'witness.gradle'
|
||||
apply plugin: 'checkstyle'
|
||||
|
||||
dependencies {
|
||||
implementation project(path: ':bramble-api', configuration: 'default')
|
||||
|
||||
@@ -7,6 +7,7 @@ apply plugin: 'idea'
|
||||
apply plugin: 'witness'
|
||||
apply from: 'witness.gradle'
|
||||
apply from: '../dagger.gradle'
|
||||
apply plugin: 'checkstyle'
|
||||
|
||||
dependencies {
|
||||
implementation project(path: ':briar-api', configuration: 'default')
|
||||
|
||||
19
config/checkstyle/checkstyle.xml
Normal file
19
config/checkstyle/checkstyle.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
<module name="Checker">
|
||||
<property name="tabWidth" value="4"/>
|
||||
<property name="charset" value="UTF-8"/>
|
||||
<module name="LineLength">
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="max" value="1000"/>
|
||||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||
</module>
|
||||
<module name="TreeWalker">
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="format" value="^\t* +\t*\S"/>
|
||||
<property name="message" value="Line has leading space characters; indentation should be performed with tabs only."/>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</module>
|
||||
</module>
|
||||
</module>
|
||||
29
gradle/checkstyle.gradle
Normal file
29
gradle/checkstyle.gradle
Normal file
@@ -0,0 +1,29 @@
|
||||
task checkstyleMain(type: Checkstyle) {
|
||||
source 'src/main/java'
|
||||
include '**/*.java'
|
||||
classpath = files()
|
||||
reports {
|
||||
xml {
|
||||
destination file("build/reports/checkstyle/main.xml")
|
||||
}
|
||||
html {
|
||||
destination file("build/reports/checkstyle/main.html")
|
||||
}
|
||||
}
|
||||
check.dependsOn it
|
||||
}
|
||||
|
||||
task checkstyleTest(type: Checkstyle) {
|
||||
source 'src/test/java'
|
||||
include '**/*.java'
|
||||
classpath = files()
|
||||
reports {
|
||||
xml {
|
||||
destination file("build/reports/checkstyle/test.xml")
|
||||
}
|
||||
html {
|
||||
destination file("build/reports/checkstyle/test.html")
|
||||
}
|
||||
}
|
||||
check.dependsOn it
|
||||
}
|
||||
Reference in New Issue
Block a user