From: David ‘Bombe’ Roden Date: Fri, 17 Feb 2017 19:07:01 +0000 (+0100) Subject: Add tasks for cloc X-Git-Tag: 0.9.7^2~291 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=352e72f14b59c8429179abb2b1139099e2dfbe92 Add tasks for cloc --- diff --git a/build.gradle b/build.gradle index 2ceb56a..a88bf84 100644 --- a/build.gradle +++ b/build.gradle @@ -100,3 +100,21 @@ findbugs { } apply plugin: 'idea' + +task countLinesMain(type: Exec) { + executable = 'cloc' + args = ['--by-file', '--xml', '--report-file=build/reports/cloc/main.xml', 'src/main'] + standardOutput = new ByteArrayOutputStream() +} + +task countLinesTest(type: Exec) { + executable = 'cloc' + args = ['--by-file', '--xml', '--report-file=build/reports/cloc/test.xml', 'src/test'] + standardOutput = new ByteArrayOutputStream() +} + +task countLines { + new File(buildDir, "reports/cloc").mkdirs() + dependsOn tasks.countLinesMain + dependsOn tasks.countLinesTest +}