X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=build.gradle;h=a88bf8439153f5c317ecba5c9ff022e831032b4e;hp=2ceb56a9db4c1bccd33727f4801aefb94f5a13a3;hb=352e72f14b59c8429179abb2b1139099e2dfbe92;hpb=acfc86d839d5a8b8c75b0198f48dd12e10128c65 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 +}