From 352e72f14b59c8429179abb2b1139099e2dfbe92 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 Feb 2017 20:07:01 +0100 Subject: [PATCH] Add tasks for cloc --- build.gradle | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 +} -- 2.7.4