From 31dfa091b9afa752eca079ace74320831bd8df3f Mon Sep 17 00:00:00 2001 From: vgaidarji Date: Mon, 4 Dec 2023 18:23:04 +0200 Subject: [PATCH] Remove PMD and Checkstyle from project Project no longer contains Java code. Will migrate over to detekt tool. --- app/build.gradle | 2 +- .../checkstyle/checkstyle-suppressions.xml | 12 -- app/config/checkstyle/checkstyle.gradle | 54 ----- app/config/checkstyle/checkstyle.xml | 201 ------------------ app/config/pmd/pmd-ruleset.xml | 68 ------ app/config/quality.gradle | 38 +--- 6 files changed, 2 insertions(+), 373 deletions(-) delete mode 100755 app/config/checkstyle/checkstyle-suppressions.xml delete mode 100755 app/config/checkstyle/checkstyle.gradle delete mode 100755 app/config/checkstyle/checkstyle.xml delete mode 100755 app/config/pmd/pmd-ruleset.xml diff --git a/app/build.gradle b/app/build.gradle index d32d8e6..4c59d5a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.android.application' apply plugin: 'org.jetbrains.kotlin.android' -//apply from: 'config/quality.gradle' +apply from: 'config/quality.gradle' apply from: 'config/jacoco.gradle' //apply from: 'config/coveralls.gradle' diff --git a/app/config/checkstyle/checkstyle-suppressions.xml b/app/config/checkstyle/checkstyle-suppressions.xml deleted file mode 100755 index 201feb0..0000000 --- a/app/config/checkstyle/checkstyle-suppressions.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/app/config/checkstyle/checkstyle.gradle b/app/config/checkstyle/checkstyle.gradle deleted file mode 100755 index 14b8a02..0000000 --- a/app/config/checkstyle/checkstyle.gradle +++ /dev/null @@ -1,54 +0,0 @@ -apply plugin: 'checkstyle' - -checkstyle { - toolVersion = '7.1.2' -} - -task checkstyleMain(type: Checkstyle) { - ignoreFailures = false - showViolations = true - - configProperties.checkstyleSuppressionsPath = - file("${project.rootDir}/app/config/checkstyle/checkstyle-suppressions.xml") - configFile file("${project.rootDir}/app/config/checkstyle/checkstyle.xml") - source 'src/main/java' - include '**/*.java' - exclude '**/gen/**' - exclude '**/R.java' - exclude '**/BuildConfig.java' - reports { - xml.destination "$project.buildDir/reports/checkstyle/main.xml" - } - // empty classpath - classpath = files() -} - -task checkstyleTest(type: Checkstyle) { - ignoreFailures = false - showViolations = true - - configProperties.checkstyleSuppressionsPath = - file("${project.rootDir}/app/config/checkstyle/checkstyle-suppressions.xml") - configFile file("${project.rootDir}/app/config/checkstyle/checkstyle.xml") - source 'src/test/java', 'src/androidTest/java' - include '**/*.java' - exclude '**/gen/**' - exclude '**/R.java' - exclude '**/BuildConfig.java' - reports { - xml.destination "$project.buildDir/reports/checkstyle/test.xml" - } - // empty classpath - classpath = files() -} - -task checkstyle(dependsOn: ['checkstyleMain', 'checkstyleTest']) { - description 'Runs Checkstyle inspection against Android sourcesets.' - group = 'Code Quality' -} - -dependencies { - checkstyle('com.puppycrawl.tools:checkstyle:7.1.2') -} - -preBuild.dependsOn('checkstyle') diff --git a/app/config/checkstyle/checkstyle.xml b/app/config/checkstyle/checkstyle.xml deleted file mode 100755 index dabcc3e..0000000 --- a/app/config/checkstyle/checkstyle.xml +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/config/pmd/pmd-ruleset.xml b/app/config/pmd/pmd-ruleset.xml deleted file mode 100755 index 1647c89..0000000 --- a/app/config/pmd/pmd-ruleset.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - Custom ruleset for Android application - - .*/R.java - .*/gen/.* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/config/quality.gradle b/app/config/quality.gradle index 3f615c6..5292371 100644 --- a/app/config/quality.gradle +++ b/app/config/quality.gradle @@ -1,6 +1,4 @@ -apply plugin: 'pmd' apply plugin: 'build-dashboard' -apply from: 'config/checkstyle/checkstyle.gradle' android { lintOptions { @@ -13,38 +11,4 @@ android { } } -task pmd(type: Pmd) { - description 'Run PMD/CPD analysis.' - group 'verification' - - ignoreFailures = true - ruleSetFiles = files("${project.rootDir}/app/config/pmd/pmd-ruleset.xml") - ruleSets = [] - - source = fileTree('src/main/java') - include '**/*.java' - exclude '**/gen/**' - - reports { - xml.enabled = true - html.enabled = true - xml { - destination "$project.buildDir/reports/pmd/pmd.xml" - } - html { - destination "$project.buildDir/reports/pmd/pmd.html" - } - } - - doLast { - File outDir = new File("$project.buildDir/reports/pmd/") - ant.taskdef(name: 'cpd', classname: 'net.sourceforge.pmd.cpd.CPDTask', - classpath: configurations.pmd.asPath) - ant.cpd(minimumTokenCount: '50', format: 'xml', - outputFile: new File(outDir, 'cpd.xml')) { - fileset(dir: "src/main/java") { - include(name: '**/*.java') - } - } - } -} +// TODO: configure detekt \ No newline at end of file